Class: WhurlEngine::ResourcesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- WhurlEngine::ResourcesController
- Defined in:
- app/controllers/whurl_engine/resources_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
11 12 13 14 15 16 |
# File 'app/controllers/whurl_engine/resources_controller.rb', line 11 def create @resource = WhurlEngine::Resource.new(params[:resource]) unless @resource.save render :partial => 'error' end end |
#destroy ⇒ Object
29 30 31 32 33 34 |
# File 'app/controllers/whurl_engine/resources_controller.rb', line 29 def destroy @resource = WhurlEngine::Resource.find(params[:id]) unless @resource.destroy render :partial => 'error' end end |
#edit ⇒ Object
18 19 20 |
# File 'app/controllers/whurl_engine/resources_controller.rb', line 18 def edit @resource = WhurlEngine::Resource.find(params[:id]) end |
#new ⇒ Object
7 8 9 |
# File 'app/controllers/whurl_engine/resources_controller.rb', line 7 def new @resource = WhurlEngine::Resource.new(:category_id => params[:category_id]) end |
#show ⇒ Object
3 4 5 |
# File 'app/controllers/whurl_engine/resources_controller.rb', line 3 def show @resource = WhurlEngine::Resource.find(params[:id]) end |
#update ⇒ Object
22 23 24 25 26 27 |
# File 'app/controllers/whurl_engine/resources_controller.rb', line 22 def update @resource = WhurlEngine::Resource.find(params[:id]) unless @resource.update_attributes(params[:resource]) render :partial => 'error' end end |