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