Permalink
Browse files

Upgrading deprecated block helper syntax (should use <%= instead of <…

…% in form_for and others).
  • Loading branch information...
daronco committed Feb 25, 2011
1 parent ad4310d commit 82e04e2d62dd5b2b2c7398df3c95e06112249adb
@@ -1,12 +1,12 @@
<div id="accept-invitation">
- <% form_for @invitation do |f| %>
+ <%= form_for @invitation do |f| %>
<%= f.hidden_field :processed, :value => true %>
<%= f.hidden_field :accepted, :value => true %>
<%= f.error_messages %>
<% unless authenticated? %>
- <% fields_for @candidate || Invitation.candidate_class.new do |cf| %>
+ <%= fields_for @candidate || Invitation.candidate_class.new do |cf| %>
<%= cf.error_messages %>
<p>
@@ -33,7 +33,7 @@
</div>
<div id="discard-invitation">
- <% form_for @invitation do |f| %>
+ <%= form_for @invitation do |f| %>
<%= f.hidden_field :processed, :value => true %>
<p>
<%= f.submit t('invitation.discard') %>
@@ -2,7 +2,7 @@
<%= t('openid.server.about_login_to', :server => @trust_root) %>
-<% form_tag url_for(:action => "create") do %>
+<%= form_tag url_for(:action => "create") do %>
<%= radio_button_tag "decision", "once" %> <%= t('openid.server.once') %><br />
<%= radio_button_tag "decision", "trust" %> <%= t('openid.server.trust') %><br />
<%= radio_button_tag "decision", "cancel" %> <%= t('openid.server.cancel') %><br />
@@ -1,4 +1,4 @@
-<% remote_form_for(edit_role_form) do |f| %>
+<%= form_for edit_role_form, :remote => true do |f| %>
<%= f.select :role_id, @roles.map{ |role| [ role.name, role.id ] }, {} %>
<%= submit_tag t('performance.change') %>
<% end -%>
@@ -1,5 +1,5 @@
<div id="new_performance_form">
- <% remote_form_for [ @stage, Performance.new ] do |f| %>
+ <%= form_for [ @stage, Performance.new ], :remote => true do |f| %>
<%= f.select :agent, @agents.map{ |a| [ a.name, "#{ a.class.base_class.to_s.underscore }-#{ a.id }" ] }%>
<%= f.select :role_id, @roles.map{ |r| [ r.name, r.id ] } %>
<%= submit_tag :add %>
@@ -1,6 +1,6 @@
<h1><%= t('role.editing') %></h1>
-<% form_for(@role) do |f| %>
+<%= form_for(@role) do |f| %>
<%= f.error_messages %>
<%= render :partial => 'form', :object => f %>
@@ -1,6 +1,6 @@
<h1><%= t('role.new') %></h1>
-<% form_for(@role) do |f| %>
+<%= form_for(@role) do |f| %>
<%= f.error_messages %>
<%= render :partial => 'form', :object => f %>
@@ -1,4 +1,4 @@
-<% form_tag session_path do -%>
+<%= form_tag session_path do -%>
<div id="login_and_password">
<p>
<label for="login"><%= t('agent.authentication.login') %></label><br/>
@@ -2,7 +2,7 @@
<%= error_messages_for :site %>
-<% form_for(:current_site, :url => site_path, :html => { :method => :put, :multipart => true }) do |f| %>
+<%= form_for(:current_site, :url => site_path, :html => { :method => :put, :multipart => true }) do |f| %>
<p>
<%= f.label :name, t('site.name') %><br />
<%= f.text_field :name %>
@@ -1,4 +1,4 @@
-<% form.fields_for :uri do |uri_form| %>
+<%= form.fields_for :uri do |uri_form| %>
<p>
<%= uri_form.label :uri, t('source.uri') %><br />
<%= uri_form.text_field :uri %>
@@ -1,6 +1,6 @@
<h1>Editing source</h1>
-<% form_for([ container, @source ]) do |f| %>
+<%= form_for([ container, @source ]) do |f| %>
<%= f.error_messages %>
<%= render :partial => 'form', :object => f %>
@@ -1,7 +1,7 @@
<h1>New source</h1>
<% setup_sources(@source).each do |source| %>
- <% form_for [ container, source ] do |f| %>
+ <%= form_for [ container, source ] do |f| %>
<%= f.error_messages %>
<%= render :partial => 'form', :object => f %>
@@ -1,7 +1,7 @@
<h1><%= t('tag.show_title', :tag => @tag.name) %></h1>
<% @taggables.each do |t| %>
- <% div_for(t) do %>
+ <%= div_for(t) do %>
<%= link_logotype t, :size => 64, :spacer => '<br />' %>
<% end %>
<% end -%>
@@ -242,6 +242,6 @@ def add_options!(opt)
opt.on("--allow-collissions",
"Don't check for class collissions") { |v| options[:allow_collissions] = true }
opt.on("--rspec",
- "Force rspec mode (checks for RAILS_ROOT/spec by default)") { |v| options[:rspec] = true }
+ "Force rspec mode (checks for Rails.root/spec by default)") { |v| options[:rspec] = true }
end
end
@@ -1,6 +1,6 @@
<h1><%%= t(:password_reset) %></h1>
-<%% form_tag lost_password_path do -%>
+<%%= form_tag lost_password_path do -%>
<p>
<label for="email"><%%= t(:email) %></label><br/>
<%%= text_field_tag 'email', params[:email] %>
@@ -1,6 +1,6 @@
<%%= error_messages_for :agent %>
-<%% form_tag reset_password_path(:reset_password_code => params[:reset_password_code]) do -%>
+<%%= form_tag reset_password_path(:reset_password_code => params[:reset_password_code]) do -%>
<p><label for="password"><%%= t(:"agent.authentication.password") %></label><br/>
<%%= password_field_tag :password %></p>
@@ -2,7 +2,7 @@
<%%= error_messages_for :agent %>
-<%% form_for :agent, :url => <%= table_name %>_path do |f| -%>
+<%%= form_for :agent, :url => <%= table_name %>_path do |f| -%>
<p><label for="login"><%%= t(:"agent.authentication.login") %></label><br/>
<%%= f.text_field :login %></p>
@@ -1,6 +1,6 @@
<h1><%%= title %></h1>
-<%% form_for @<%= singular_name %> do |f| %>
+<%%= form_for @<%= singular_name %> do |f| %>
<%%= f.error_messages %>
<%%= render :partial => 'form', :object => f %>
@@ -1,6 +1,6 @@
<h1><%%= title %></h1>
-<%% form_for @<%= singular_name %> do |f| %>
+<%%= form_for @<%= singular_name %> do |f| %>
<%%= f.error_messages %>
<%%= render :partial => 'form', :object => f %>
@@ -160,7 +160,7 @@ def not_authenticated
#
# We can return to this location by calling #redirect_back_or_default.
def store_location(uri = nil)
- session[:return_to] = uri || request.request_uri
+ session[:return_to] = uri || request.fullpath
end
# Redirect to the URI stored by the most recent store_location call or
@@ -85,7 +85,7 @@ def not_authorized
end
format.html do
- render(:file => "#{RAILS_ROOT}/public/403.html",
+ render(:file => "#{Rails.root.to_s}/public/403.html",
:status => 403)
end
end

0 comments on commit 82e04e2

Please sign in to comment.