Created
August 3, 2013 10:49
-
-
Save gaishimo/6146071 to your computer and use it in GitHub Desktop.
Controller : render
This file contains 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
respond_to do |format| | |
if @magazine.save | |
format.html { redirect_to @magazine, notice: 'Magazine was successfully created.' } | |
format.json { render json: @magazine, status: :created, location: @magazine } | |
else | |
format.html { render action: "new" } | |
format.json { render json: @magazine.errors, status: :unprocessable_entity } | |
end | |
end | |
def show | |
@magazine = Magazine.find(params[:id]) | |
respond_to do |format| | |
format.html # show.html.erb | |
format.json { render json: @magazine } | |
end | |
end |
This file contains 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
render :json => {:notify_message => I18n.t('pages.not_found.body') },:status => 404 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment