Add short-cuts in Controller for CRUD helper routes:
class Example < Harbor::Application
class Home < Harbor::Controller
index do
response.puts "Welcome home!"
end
show do |id|
response.puts "You asked me to show #{id}"
end
update do |id|
response.puts "Aight, stand back, I've got this! (#{id})"
end
delete do |id|
response.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
Add short-cuts in Controller for CRUD helper routes:
Note:
lib/harbor/helpers/crud_routes.rb
to keep them organized, and make them easy to document/reference for people learning the framework