tiny urls redirection
This commit is contained in:
parent
22e8183508
commit
0e2c14518f
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user