From bad8766a116471895981c18d724ed11042f1907c Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Mon, 7 Jul 2014 11:57:47 -0300 Subject: [PATCH] Update every old syntax of form_for and javascript_tag --- app/views/invite/_dialog_wait_loading.html.erb | 2 +- app/views/manage_products/_certifiers_for_selection.html.erb | 2 +- app/views/manage_products/_display_name.html.erb | 2 +- app/views/manage_products/_edit_input.html.erb | 2 +- app/views/manage_products/_form.html.erb | 2 +- app/views/manage_products/_price_composition_bar.html.erb | 2 +- app/views/manage_products/new.html.erb | 2 +- app/views/profile/report_abuse.html.erb | 2 +- app/views/search/_image.html.erb | 2 +- app/views/search/search_page.html.erb | 2 +- app/views/shared/_dialog_error_messages.html.erb | 2 +- app/views/shared/_numbers_only_javascript.html.erb | 2 +- app/views/shared/_redirect_via_javascript.html.erb | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/views/invite/_dialog_wait_loading.html.erb b/app/views/invite/_dialog_wait_loading.html.erb index 360723c..6081927 100644 --- a/app/views/invite/_dialog_wait_loading.html.erb +++ b/app/views/invite/_dialog_wait_loading.html.erb @@ -1,4 +1,4 @@ -<% javascript_tag do %> +<%= javascript_tag do %> jQuery(function($) { $("#loading-dialog").dialog({ height: 160, diff --git a/app/views/manage_products/_certifiers_for_selection.html.erb b/app/views/manage_products/_certifiers_for_selection.html.erb index 07ae53a..99eecea 100644 --- a/app/views/manage_products/_certifiers_for_selection.html.erb +++ b/app/views/manage_products/_certifiers_for_selection.html.erb @@ -1,4 +1,4 @@ <%= select_certifiers(@qualifier) + remove_qualifier_button %> -<% javascript_tag do %> +<%= javascript_tag do %> jQuery('#product-qualifiers-list *').removeClass('small-loading') <% end %> diff --git a/app/views/manage_products/_display_name.html.erb b/app/views/manage_products/_display_name.html.erb index ec64e4e..23d14ca 100644 --- a/app/views/manage_products/_display_name.html.erb +++ b/app/views/manage_products/_display_name.html.erb @@ -2,7 +2,7 @@

<%= @product.name_with_unit %>

<%= edit_product_link_to_remote(@product, 'name', _('Edit name and unit'), :title => _('Click here to edit the name of your product and the unit')) %> -<% javascript_tag do %> +<%= javascript_tag do %> $$('#display-product-category .hierarchy-category')[0].update('<%= escape_javascript(hierarchy_category_navigation( @product.product_category, diff --git a/app/views/manage_products/_edit_input.html.erb b/app/views/manage_products/_edit_input.html.erb index dd53531..61d1425 100644 --- a/app/views/manage_products/_edit_input.html.erb +++ b/app/views/manage_products/_edit_input.html.erb @@ -1,4 +1,4 @@ -<%= form_for(@input, :url => {:controller => 'manage_products', :action => 'edit_input', :id => @input}, +<%= form_for(:input, :url => {:controller => 'manage_products', :action => 'edit_input', :id => @input}, :html => {:method => 'post', :id => "edit-input-#{ @input.id }-form"}) do |f| %> <%= hidden_field_tag 'input-bar-update-url', @input.product.price_composition_bar_display_url, :class => 'bar-update-url' %> diff --git a/app/views/manage_products/_form.html.erb b/app/views/manage_products/_form.html.erb index 29a77a8..8639138 100644 --- a/app/views/manage_products/_form.html.erb +++ b/app/views/manage_products/_form.html.erb @@ -1,6 +1,6 @@ <%= error_messages_for :product %>
-<%= form_for :product, @product, :html => {:multipart => true }, :url => {:action => mode} do |f| %> +<%= form_for :product, :html => {:multipart => true }, :url => {:action => mode} do |f| %> <%= required_fields_message %> <%= display_form_field( _('Name:'), f.text_field(:name) ) %> diff --git a/app/views/manage_products/_price_composition_bar.html.erb b/app/views/manage_products/_price_composition_bar.html.erb index 57f19e4..7ec3d97 100644 --- a/app/views/manage_products/_price_composition_bar.html.erb +++ b/app/views/manage_products/_price_composition_bar.html.erb @@ -1,4 +1,4 @@ -<% javascript_tag do %> +<%= javascript_tag do %> var value = <%= @product.price_description_percentage %>; var total_cost = <%= @product.total_production_cost %>; var price = '<%= @product.formatted_value(:price) %>'; diff --git a/app/views/manage_products/new.html.erb b/app/views/manage_products/new.html.erb index c857b95..5e1aced 100644 --- a/app/views/manage_products/new.html.erb +++ b/app/views/manage_products/new.html.erb @@ -25,6 +25,6 @@ <% end %> -<% javascript_tag do %> +<%= javascript_tag do %> toggleDisabled(<%= @category && @category.accept_products? ? 'true' : 'false' %>, $('save_and_continue')) <% end %> diff --git a/app/views/profile/report_abuse.html.erb b/app/views/profile/report_abuse.html.erb index 1c44ccb..0b63206 100644 --- a/app/views/profile/report_abuse.html.erb +++ b/app/views/profile/report_abuse.html.erb @@ -1,4 +1,4 @@ -<%= form_for @abuse_report, :url => {:action => 'register_report'}, +<%= form_for :abuse_report, :url => {:action => 'register_report'}, :html => {:onsubmit => "return send_request(this)", :id => 'report-abuse-form'} do |f| %> <%= labelled_form_field('* ' + _('Report reasons'), f.text_area(:reason, :rows => 6, :cols => 60, :class => 'required')) %> <%= hidden_field_tag(:content_type, params[:content_type]) %> diff --git a/app/views/search/_image.html.erb b/app/views/search/_image.html.erb index add9fc9..b3800c0 100644 --- a/app/views/search/_image.html.erb +++ b/app/views/search/_image.html.erb @@ -5,7 +5,7 @@ <% if ['jpg', 'jpeg', 'gif', 'png', 'tiff', 'svg'].include? extension %> <%= link_to '', image.view_url, :class => "search-image-pic", :style => 'background-image: url(%s)'% image.public_filename(:thumb) %> <% if image.width && image.height %> - <% javascript_tag do %> + <%= javascript_tag do %> image = jQuery('script').last().parent().find('.search-image-pic'); des_width = parseInt(image.css('width')); des_height = parseInt(image.css('height')); diff --git a/app/views/search/search_page.html.erb b/app/views/search/search_page.html.erb index 2222e51..7fdb9d1 100644 --- a/app/views/search/search_page.html.erb +++ b/app/views/search/search_page.html.erb @@ -11,7 +11,7 @@
<% if @asset == :product %> - <% javascript_tag do %> + <%= javascript_tag do %> jQuery('.search-product-price-details').altBeautify(); <% end %> <% end %> diff --git a/app/views/shared/_dialog_error_messages.html.erb b/app/views/shared/_dialog_error_messages.html.erb index 8774086..743b78d 100644 --- a/app/views/shared/_dialog_error_messages.html.erb +++ b/app/views/shared/_dialog_error_messages.html.erb @@ -1,4 +1,4 @@ -<% javascript_tag do %> +<%= javascript_tag do %> close_loading() jQuery('#errorExplanation h2').hide() jQuery('#errorExplanation p').hide() diff --git a/app/views/shared/_numbers_only_javascript.html.erb b/app/views/shared/_numbers_only_javascript.html.erb index 6d77641..85bc72b 100644 --- a/app/views/shared/_numbers_only_javascript.html.erb +++ b/app/views/shared/_numbers_only_javascript.html.erb @@ -1,4 +1,4 @@ -<% javascript_tag do %> +<%= javascript_tag do %> jQuery(".numbers-only").keypress(function(event) { var separator = "<%= environment.currency_separator %>" return numbersonly(event, separator) diff --git a/app/views/shared/_redirect_via_javascript.html.erb b/app/views/shared/_redirect_via_javascript.html.erb index 6ded388..9786064 100644 --- a/app/views/shared/_redirect_via_javascript.html.erb +++ b/app/views/shared/_redirect_via_javascript.html.erb @@ -1,4 +1,4 @@ -<% javascript_tag do %> +<%= javascript_tag do %> update_loading('<%= _('redirecting...') %>') redirect_to('<%= url %>') <% end %> -- libgit2 0.21.2