tiny urls redirection

This commit is contained in:
Nicolas Bally 2012-08-20 18:55:22 +02:00
parent 22e8183508
commit 0e2c14518f

View File

@ -45,11 +45,11 @@ class TinyUrlsController < ApplicationController
respond_to do |format|
if @tiny_url.save
format.html { redirect_to @tiny_url, notice: 'Tiny url was successfully created.' }
format.json { render json: @tiny_url, status: :created, location: @tiny_url }
format.html { redirect_to tiny_urls_url, notice: 'Tiny url was successfully created.' }
else
format.html { render action: "new" }
format.json { render json: @tiny_url.errors, status: :unprocessable_entity }
end
end
end
@ -61,11 +61,11 @@ class TinyUrlsController < ApplicationController
respond_to do |format|
if @tiny_url.update_attributes(params[:tiny_url])
format.html { redirect_to @tiny_url, notice: 'Tiny url was successfully updated.' }
format.json { head :no_content }
format.html { redirect_to tiny_urls_url, notice: 'Tiny url was successfully updated.' }
else
format.html { render action: "edit" }
format.json { render json: @tiny_url.errors, status: :unprocessable_entity }
end
end
end