I am working with Railsspace social networking book. I stuck in the problem when i am doing paginate for the search result. It gives the following error. NoMethodError in CommunityController#index undefined method `paginate'' for #<CommunityController:0x57436f0> My Controller Index page coding is below def index @title = "Community" @letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("") if params[:id] @initial = params[:id] @pages, specs = paginate(:specs, :conditions => ["last_name LIKE ?", @initial+"%"], :order => "last_name, first_name") @users = specs.collect { |spec| spec.user } end end Please help me out. Any help is appreciable. Thanks Amir -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
El martes, 22 de mayo de 2012 15:37:04 UTC+2, Ruby-Forum.com User escribió:> > I am working with Railsspace social networking book. I stuck in the > problem when i am doing paginate for the search result. It gives the > following error. > > NoMethodError in CommunityController#index > > undefined method `paginate'' for #<CommunityController:0x57436f0> > > My Controller Index page coding is below > > def index > @title = "Community" > @letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("") > if params[:id] > @initial = params[:id] > @pages, specs = paginate(:specs, > :conditions => ["last_name LIKE ?", @initial+"%"], > :order => "last_name, first_name") > @users = specs.collect { |spec| spec.user } > end > end > > Please help me out. > > Any help is appreciable. > > Thanks > Amir > > -- > Posted via http://www.ruby-forum.com/. >You dont have a "def paginate " method defined in your controller. Anyway you''ll probably want to use a pagination gem such as Kaminari, which includes all you need for that purpose. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Ui4ykZGwxHQJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> You dont have a "def paginate " method defined in your controller. > Anyway you''ll probably want to use a pagination gem such as Kaminari, > which > includes all you need for that purpose.Hi Juan, Thanks for the help message. Juan I am newbie on ROR could you please help me how to install kaminari. Is it right command to run "gem install kaminari" as I am working on windows. Thanks in advance Amir -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
El miércoles, 23 de mayo de 2012 08:31:51 UTC+2, Ruby-Forum.com User escribió:> > > You dont have a "def paginate " method defined in your controller. > > Anyway you''ll probably want to use a pagination gem such as Kaminari, > > which > > includes all you need for that purpose. > > Hi Juan, > > Thanks for the help message. Juan I am newbie on ROR could you please > help me how to install kaminari. > > Is it right command to run "gem install kaminari" as I am working on > windows. > > Thanks in advance > Amir > > -- > Posted via http://www.ruby-forum.com/. >It''s right, but your best approach is to add ''gem kaminari'' to your Gemfile and to use rvm. I don''t have much experience on rails + windows issues, but I know they can be a real pain, so I''d also suggest that you use linux instead for rails development, in a virtual machine if for some reason you can''t install linux in your computer. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/OHLT1AguKowJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tuesday, 22 May 2012 09:37:04 UTC-4, Ruby-Forum.com User wrote:> > I am working with Railsspace social networking book. I stuck in the > problem when i am doing paginate for the search result. It gives the > following error. > >Don''t use that book - it''s severely outdated and will cause you a lot of problems. See here for details: http://ruby.railstutorial.org/?railsspace=1 --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/1cj567HQSH8J. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.