A proof of concept of having Sinatra like routes inside your controllers.
Since the router is gone, feel free to remove config/routes.rb.
Then add the file below to lib/action_controller/inline_routes.rb
inside your app.
| { | |
| "dialog-breakpoints": { | |
| "desktop": "'min-width: 701px'", | |
| "mobile": "'max-width: 700px'" | |
| } | |
| } |
(The below text is licensed with CC0, which means that if you want to use or translate it, that is OK by me.)
Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺
Locally, I'm at this commit:
$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <[email protected]>
Date: Sun Apr 15 16:35:03 2012 +0200
| class PostsController < ActionController::Base | |
| def create | |
| Post.create(post_params) | |
| end | |
| def update | |
| Post.find(params[:id]).update_attributes!(post_params) | |
| end | |
| private |
| require 'csv' | |
| class Exporter | |
| DEFAULT_EXPORT_TABLES = [ Invoice, InvoiceItem, Item, Merchant, Transaction, User ] | |
| DESTINATION_FOLDER = "tmp/" | |
| def self.export_tables_to_csv(tables = DEFAULT_EXPORT_TABLES) | |
| tables.each { |klass| export_table_to_csv(klass) } | |
| end |