sam/harbor — Issue #25: Add CRUD helper routes
Author: sam
Created: 2012-03-01 16:50:53+00:00
State: open
Labels: controllers

Add short-cuts in Controller for CRUD helper routes:

class Example < Harbor::Application
class Home < Harbor::Controller

index do
render.puts "Welcome home!"
end

show do |id|
render.puts "You asked me to show #{id}"
end

update do |id|
render.puts "Aight, stand back, I've got this! (#{id})"
end

delete do |id|
render.puts "#{id} is going down!"
end

end # Controller: Home
end # Application: Example

**Note**:

* Fully implementing this is going to depend on issue #17
* I recommend putting this somewhere like `lib/harbor/helpers/crud_routes.rb` to keep them organized, and make them easy to document/reference for people learning the framework