Class: WhurlEngine::ChaptersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- WhurlEngine::ChaptersController
- Defined in:
- app/controllers/whurl_engine/chapters_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 |
# File 'app/controllers/whurl_engine/chapters_controller.rb', line 7 def create @chapter = WhurlEngine::Chapter.new(params[:chapter]) unless @chapter.save render :partial => 'error' end end |
#destroy ⇒ Object
25 26 27 28 29 30 |
# File 'app/controllers/whurl_engine/chapters_controller.rb', line 25 def destroy @chapter = WhurlEngine::Chapter.find(params[:id]) unless @chapter.destroy render :partial => 'error' end end |
#edit ⇒ Object
14 15 16 |
# File 'app/controllers/whurl_engine/chapters_controller.rb', line 14 def edit @chapter = WhurlEngine::Chapter.find(params[:id]) end |
#new ⇒ Object
3 4 5 |
# File 'app/controllers/whurl_engine/chapters_controller.rb', line 3 def new @chapter = WhurlEngine::Chapter.new(:story_id => params[:story_id]) end |
#update ⇒ Object
18 19 20 21 22 23 |
# File 'app/controllers/whurl_engine/chapters_controller.rb', line 18 def update @chapter = WhurlEngine::Chapter.find(params[:id]) unless @chapter.update_attributes(params[:chapter]) render :partial => 'error' end end |