Last active
August 29, 2015 14:10
-
-
Save ryanjones/0953319cab81fca2cad9 to your computer and use it in GitHub Desktop.
Leverage decent exposure
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 characters
# 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_path) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment