Permalink
Browse files

shortening render calls in controller

  • Loading branch information...
1 parent f8c2e08 commit 6b192e78137884f15b2d8e31b0b907ae13a32c9c @ryanb committed Apr 29, 2011
@@ -9,7 +9,7 @@ def create
if @<%= session_singular_name %>.save
redirect_to_target_or_default root_url, :notice => "Logged in successfully."
else
- render :action => 'new'
+ render :new
end
end
@@ -29,7 +29,7 @@ def create
redirect_to_target_or_default root_url, :notice => "Logged in successfully."
else
flash.now[:alert] = "Invalid login or password."
- render :action => 'new'
+ render :new
end
end
@@ -13,7 +13,7 @@ def create
<%- end -%>
redirect_to root_url, :notice => "Thank you for signing up! You are now logged in."
else
- render :action => 'new'
+ render :new
end
end
@@ -26,7 +26,7 @@ def update
if @<%= user_singular_name %>.update_attributes(params[:<%= user_singular_name %>])
redirect_to root_url, :notice => "Your profile has been updated."
else
- render :action => 'edit'
+ render :edit
end
end
end
@@ -3,6 +3,6 @@ def create
if @<%= instance_name %>.save
redirect_to <%= item_url %>, :notice => "Successfully created <%= class_name.underscore.humanize.downcase %>."
else
- render :action => 'new'
+ render :new
end
end
@@ -3,6 +3,6 @@ def update
if @<%= instance_name %>.update_attributes(params[:<%= instance_name %>])
redirect_to <%= item_url %>, :notice => "Successfully updated <%= class_name.underscore.humanize.downcase %>."
else
- render :action => 'edit'
+ render :edit
end
end

0 comments on commit 6b192e7

Please sign in to comment.