Last active
August 29, 2015 14:10
-
-
Save ryanjones/0953319cab81fca2cad9 to your computer and use it in GitHub Desktop.
Revisions
-
Ryan Jones revised this gist
Nov 26, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,6 +22,6 @@ def update def destroy item.destroy redirect_to(items_path) end end -
Ryan Jones created this gist
Nov 26, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ # controller w/ decent exposure class ItemsController < ApplicationController expose(:item) expose(:items) def create if item.save redirect_to(item) else render :new end end def update if item.save redirect_to(item) else render :edit end end def destroy item.destroy redirect_to(items_url) end end