From c185e680396f409fa1621a66ce9b53237254df0c Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Wed, 9 Dec 2015 15:48:32 -0300 Subject: [PATCH] Fix for rails4 --- Gemfile | 1 + controllers/profile/pairwise_plugin_suggestions_controller.rb | 2 +- views/pairwise_plugin_profile/_suggestion_form.html.erb | 6 +++--- views/pairwise_plugin_suggestions/no_result.html.erb | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 views/pairwise_plugin_suggestions/no_result.html.erb diff --git a/Gemfile b/Gemfile index 8bef609..49f81ac 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,6 @@ source 'https://rubygems.org' gem 'vcr' +gem 'activeresource', require: 'active_resource' group :test do gem 'webmock' diff --git a/controllers/profile/pairwise_plugin_suggestions_controller.rb b/controllers/profile/pairwise_plugin_suggestions_controller.rb index 055fb31..1c67f16 100644 --- a/controllers/profile/pairwise_plugin_suggestions_controller.rb +++ b/controllers/profile/pairwise_plugin_suggestions_controller.rb @@ -11,7 +11,7 @@ class PairwisePluginSuggestionsController < ProfileController return no_result if @pairwise_content.question.nil? @choices = list_choices @choices = WillPaginate::Collection.create(params[:page] || 1, 20, @choices.length) do |pager| - pager.replace(@choices.slice(pager.offset, pager.per_page)) + pager.replace(@choices.to_a.slice(pager.offset, pager.per_page)) end end diff --git a/views/pairwise_plugin_profile/_suggestion_form.html.erb b/views/pairwise_plugin_profile/_suggestion_form.html.erb index 1b7aad6..a73c4f7 100644 --- a/views/pairwise_plugin_profile/_suggestion_form.html.erb +++ b/views/pairwise_plugin_profile/_suggestion_form.html.erb @@ -1,4 +1,4 @@ - <%= remote_form_for('idea', :url => pairwise_suggestion_url(pairwise_content, embeded, source), + <%= remote_form_for(pairwise_content, :url => pairwise_suggestion_url(pairwise_content, embeded, source), :html => {:id => "pairwise_suggestion_form_#{pairwise_content.id}"}, :loading => "jQuery('#pairwise_suggestion_form_#{pairwise_content.id} .suggestion_box_fields').hide();jQuery('#pairwise_suggestion_form_#{pairwise_content.id} .suggestion_box_loading').show();", :loaded => "jQuery('#pairwise_suggestion_form_#{pairwise_content.id} .suggestion_box_fields').show();jQuery('#pairwise_suggestion_form_#{pairwise_content.id} .suggestion_box_loading').hide();") do |f| %>
@@ -7,10 +7,10 @@
<%= flash[:notice] %>
-
+
<%= text_area :idea, :text, :maxlenght => 160, :rows => 4, :placeholder => _('Type your idea here') %> -
+
<%= submit_button('', _("Send"), :id => 'new_idea_button', :class => user ? '':'require-login-popup') %>
diff --git a/views/pairwise_plugin_suggestions/no_result.html.erb b/views/pairwise_plugin_suggestions/no_result.html.erb new file mode 100644 index 0000000..4554f78 --- /dev/null +++ b/views/pairwise_plugin_suggestions/no_result.html.erb @@ -0,0 +1 @@ +<%= _('No Result') %> -- libgit2 0.21.2