Displaying 20 results from an estimated 2000 matches similar to: "how to rename a method of a module."
2007 Dec 03
1
undefined methods page_count
I''m getting "undefined method `page_count'' for #<Array:0xb7073e1c>"
when I tried to run my rails application after installing
will_paginate. Details are as below:
undefined method `page_count'' for #<Array:0xb7073e1c>
Extracted source (around line #7):
4: <%= a.text%>
5: <% end %>
6:
7: <%= will_paginate @announcements,
2010 Jul 23
0
alias_method_chain with i18n
Hello,
I was investigating solutions for i18n with will_paginate and I found
a possible solution at http://lawrencesong.net/2009/01/enable-i18n-in-will_paginate-plugin/
The author adds to application_helper.rb the following code:
#############################################
include WillPaginate::ViewHelpers
def will_paginate_with_i18n(collection, options = {})
2009 Mar 21
2
ApplicationHelper::WillPaginate (NameError)
What wrong?
environment.rb
require "will_paginate"
application_helper.rb
include WillPaginate::ViewHelpers
def will_paginate_with_i18n(collection, options = {})
will_paginate_without_i18n(collection, options.merge(:previous_label =>
I18n.t(:previous), :next_label => I18n.t(:next)))
end
alias_method_chain :will_paginate, :i18n
2008 Jun 22
1
will paginate?
I installed the gem will_paginate and made a simple view to mess out
how it works
in the controller i have
@sites = Site.paginate :per_page => 10, :page => params[:page]
simple view
<% for @sites in @sites %>
<%= @sites.naam %>
<%= will_paginate @sites %>
<% end %>
but i got no result
ActionView::TemplateError (undefined method `page_count''
2011 Aug 23
2
Where is WillPaginate::Finders ???
Hi All!
It''s been a while since I had to ask for help, but I''m back!
I''ve finished beta testing my big app and started the transition to
production. Everything went fine and the production version was working
till I was asked to add another model :-( (Almost a year of beta
testing and they only come up with it after moving to production :-D )
I successfully
2010 Jul 20
2
uninitialized constant WillPaginate::LinkRenderer
This is becoming painful. Where the file should be? What should be in
it? I am running will_paginate 3.0.pre
Here is my current code sitting in initializers/
class WillPaginateRenderer < WillPaginate::LinkRenderer
def rel_value(page)
"nofollow"
end
end
Thanks for your help,
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed
2009 May 18
3
Pagination
Hi,
I am using the will_paginate plugin for my application.
It is showing Previous 1,2,3...22,23,24 Next links
How will I hide the numbers?
I want to have first and last links also. How will i do that?
Thanks in advance.
--
Posted via http://www.ruby-forum.com/.
2011 Jul 15
0
Writing test for CacheHelper
Hi,
I''m working to patch actionpack/lib/action_view/helpers/
cache_helper.rb so that it doesn''t throw when ouput_buffer isn''t
ActionView::OutputBuffer but is still html_safe. In 3-0-stable the
function contains the following if:
if output_buffer.is_a?(ActionView::OutputBuffer)
safe_output_buffer = output_buffer.to_str
fragment =
2008 Oct 27
8
pagination in ajax
hi,
I am curently using rails version 2.1.1.
Currently i have done simple pagination using will_paginate
plugin.it works.but when i am trying pagination using ajax
with help of will_paginate plugin
it wont works.i am also using RemoteLinkRenderer helper,
but it gives an error uninitialized constant RemoteLinkRenderer.
can anyone provide any tutorial or sample code so that i can
2008 Apr 17
1
redbox + will_paginate
Hiya,
I''m trying to use Will_paginate with the RedBox plugin but having
problems making it go to the next page of the collection.
http://blog.craigambrose.com/articles/2006/09/22/redbox-release-2
as far as i can see will_paginate does not support any kind of :remote
ajax call so each page click can update the div element.
has anyone managed to get will_paginate working within a redbox
2009 Aug 24
4
will_paginate: pagination links are wrong
I put everything in a pastie to make it a bit more readable:
http://pastie.org/593379
This is the gist:
Will_paginate doesn''t play quite nice. The first result set is fine,
and when I click on one of the paginated links, it returns the following
error:
Couldn''t find DictatedExam with ID=filter_widget
observe_field triggers filter_widget which calls the paginated search..
Which
2011 May 25
1
rake task: uninitialized constant
I have this rake taks:
CUSTOM_MONTHS = [nil, "GEN", "FEB", "MAR", "APR", "MAG", "GIU", "LUG",
"AGO", "SET", "OTT", "NOV", "DIC"]
def parse_date_string(date_string)
begin
day, month, year = date_string.split("-")
Time.mktime(year, CUSTOM_MONTHS.index(month),
2010 Jan 21
2
will_paginate ?
Does anyone have experience with will_paginate?
I''m trying to use it with acts_as_ferret.
routes.rb
...
map.search ''/search'', :controller => ''notes'', :action => ''search''
notes.rb
...
acts_as_ferret :fields => [ ''body'' ]
notes_controller.rb
...
def search
if params[ :query ]
@query = params[
2009 Mar 24
12
MonkeyPatching ActiveRecord::Base class
I am trying to monkey-patch the ActiveRecord::Base class to incorporate
a generic search class method so that it can be used by all model
classes which need this functionality. Since model classes directly
inherit from ActiveRecord::Base and unlike controllers and helpers, do
not have an ancestor class defined, I think I am forced to open the
ActiveRecord::Base class and patch it? May be I am
2005 Dec 27
0
Re: RESOLVED: Overloading error_message_on method in ActiveRecordHelper
Leaving the body of the method the same as the default still throws
the "stack level too deep" error. As a matter of fact, it only
disappears if I comment out the ''require'' in line 1.
As it turned out, it was the method definiton itself that caused
problems. Ruby doesn''t have keyword arguments, but I tried calling the
method as if it had. But when I changed
2010 May 17
6
Should an blank string be html_safe?
Just trying to implement a simple helper over the past few days had me
really confused.
messages = ''''
messages << content_tag(:p, ''dave'')
#=> <p>dave<\p%;gt;
Eventually I realised the original empty string was not html_safe
message = ''''.html_safe
message << content_tag(:p, ''dave'')
#=>
2007 Jul 19
8
Where do I put code for my own types?
Sorry for all the questions today...
Beyond the obvious things--models, controllers, helpers, and other
framework-related types--where should I put the code for my own types?
For example, I was thinking of writing my own AJAX-friendly paginator,
but I don''t know where to put the code for that sort of thing.
I would prefer to keep things object-oriented, so I would rather do a
lot of
2008 May 19
0
changed to will_paginate
Hi
Till now we used the rails pagination.But now onwards shifting to
will_paginate
The code I use currently is as below .This is with the help of
find_where pluggin..A fantastic pluggin which we still want to use...I
would like to know how can i modify the following code to work with
will_paginate
step 1: set the variables you''ll need
page = (params[:page] ||= 1).to_i
2007 Dec 23
8
will_paginate wont_paginate for me!
Sorry for the cheesy topic name couldn''t resist.
B4 I go into details I''m rocking Rails 1.2.6. I''m hosting on MediaTemple
and they seem to working on some issue between their grid servers and
2.0.
I''m struggling with pagination. I spent a few hours discovering that
everyone thinks you should use a plugin to do your paginations. It seems
will_paginate is
2010 Aug 03
7
rails 2.3.8 and html_safe
Hi,
Can somebody update me on the state of html_safe strings in rails 2.3.8?
I know rails 2.3.6 and 2.3.7 broke a lot of code because strings were
being escaped when they shouldn''t have been and I thought this was all
fixed in 2.3.8.
I''m upgrading an app from 2.3.5 to 2.3.8 and there are many spots where
previous code was output correctly and now it expects html_safe method