RailsCasts Pro episodes are now free!

Learn more or hide this

Rajveer Shekhawat's Profile

GitHub User: rvsingh

Comments by Rajveer Shekhawat

Avatar

Hi

Can someone help me here. I am new with rails and trying to dynamically add fixed number of pre-populated nested forms using cocoon. Please be kind enough to read more details here.

http://stackoverflow.com/questions/15072932/dynamically-adding-fixed-number-of-prepopulated-nested-forms

Thanks a lot!!

Avatar

Make this change in routes. And it works.

resources :styles do
collection do
match 'search' => 'styles#index', :via => [:get, :post], :as => :search
end
end

Avatar

Hi

I am trying to use will_paginate with ransack.

controller
@search = Style.search(params[:q])
@styles = @search.result(:distinct => true).paginate(:page => params[:page], :per_page => 5)

index
<%= will_paginate @styles %>

Rest of the code is same as in this tutorial. But pagination links are not working. Really stuck with it. Please help.