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| %>