Last active
December 19, 2015 02:59
-
-
Save tonyc/5886909 to your computer and use it in GitHub Desktop.
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
class ThingsController < ApplicationController | |
load_and_authorize_resource :thing | |
def index | |
respond with @things | |
end | |
def show | |
respond_with @thing | |
end | |
def edit | |
respond_with @thing | |
end | |
def update | |
@thing.update_attributes(thing_params) | |
respond_with @thing | |
end | |
def new | |
respond_with @thing | |
end | |
def create | |
respond_with @thing.tap(&:save) | |
end | |
def destroy | |
respond_with @thing.tap(:destroy) | |
end | |
private | |
def thing_params | |
params.require(:thing).permit(:foo, :bar) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment