Displaying 20 results from an estimated 30000 matches similar to: "Will paginate is an API ?"
2008 Nov 27
7
will_paginate issue
Hi,
I am trying paginate (will_paginate) users posts. It is counting and
showing the page links correctly, but still showing all the posts on one
page.
@entries = @user.entries.paginate :per_page => 5, :page =>
params[:page], :order => ''created_at DESC''
If I change it to @entries = Entry.paginate :per_page => 5 ........
It is fine, but I would like to show only
2008 Mar 31
10
Paginate with Rails 2.0.2 question
Hi,
So I''m using @post_pages, @posts = paginate :posts, :per_page => 10
to paginate.
But I have rails 2.0.2 on my VPS. Now this version of paginate throws
an error. What happened to classic pagination and what is done now?
Thanks,
Ron
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
2009 Dec 22
16
Will paginate is missing on rake db:migrate
I have a very annoying problem, when doing rake db:migrate, I get the
error message:
Missing these required gems:
will_paginate ~> 2.3.11
But the gem is not missing, It runs very well in my app. To make the
rake pass I have to comment out the gem in my environment.rb file.
environment.rb:
config.gem "will_paginate", :version => "~> 2.3.11", :source =>
2008 Sep 03
5
Eager load associations in Oracle problem with more than 1000 records
I think Rails 2.1 introduced a bug when eager loading of associations
with Oracle. In 2.1 ActiveRecord loads the included table with a big
''IN'' query: ''where association.id in (1, 2, 3, 4...)''. The problem
is that Oracle has a hard limit of 1000 values in an IN clause. I get
this error:
''OCIError: ORA-01795: maximum number of expressions in a list
2009 Nov 03
2
will_paginate pagination problem
hi;
i use will_paginate the first page come true but all other page get the
same data of first page i checked in controller "page" parameter works
true but paginate get only first page''s data and shows these data in all
pages
forexample first page seen A,B second page also seen A,B but second page
must be C,D
my code is;
controller :
@list = Company::Env.paginate :page =>
2009 Jun 17
4
Serverside AjaxRequest or AjaxUpdater detections
Hi all,
This question might be a long shot, but I''m going to ask it anyway. In
my application, I''ve created a before_filter that does some magic. It
looks like this:
if request.xhr? then
render :update do |page|
page.redirect_to url_for_thingy
end
else
redirect_to redirect_to url_for_thingy
end
This works perfectly, however, I have one annoyance. On the server side,
2009 Apr 22
4
help with exceptions
Hello,
I was trying to to write a simple ruby program for exceptions.
My code is:
class ABC
begin
alpha = ABC.new
alpha.foo= [1,2,3]
puts foo.inspect.to_s
NonExisting
raise "all other exceptions"
rescue Exception => NoMethodError
puts ''Hello''
puts $ERROR_INFO.inspect
rescue Exception => NameError
puts ''goodbye''
puts $ERROR_INFO.inspect
else
2009 Apr 21
12
still cannot install rails on windows
if i follow the instructions on:
http://agilo.us/2009/03/15/rails-on-windows/
the command
gem install sqlite3-ruby
will give
---------------------------------
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
c:/ruby/bin/ruby.exe extconf.rb
checking for fdatasync() in rt.lib... no
checking for
2011 Dec 07
5
Find_by_sql help?
How to make it work with paginator (kaminari)?
MySQL and full text search: Words (id, word)
@words = Word.find_by_sql(["SELECT id, word, MATCH (word) AGAINST (?) AS
Score FROM words WHERE MATCH (word) AGAINST (?) ORDER BY Score Desc,
word!=?", params[:search],params[:search],params[:search]])
I can''t add .page(params[:page]).per(5) to the end of "find_by_sql()" so
2009 Mar 25
6
Hash with key and value from ActiveRecord?
Heya,
I think I have thinking barrier. I just want a simple hash out of an
ActiveRecord.
@attributes = Attribute.find_all_by_character_id(@character).hash {
|u| [u.name, u.value] }
and I would like to access it like
@attributes[:health]
but it doesn''t work. Anyone can help me out with that?
--
Posted via http://www.ruby-forum.com/.
2009 May 03
13
Ruby or Rails bug?
In irb all works fine:
# irb
irb(main):001:0> require ''rubygems''
=> true
irb(main):002:0> require ''raspell''
=> true
irb(main):003:0> speller = Aspell.new("ru_RU")
=> #<Aspell:0x7f8692c9d158>
irb(main):004:0> speller.suggestion_mode = Aspell::NORMAL
=> "normal"
irb(main):005:0>
2009 Apr 11
3
Updated today - number of rows
How can I get number of rows that was updated "today"?
Table: messages (id, title, message, updated_at)
--
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
2008 Feb 22
7
undefined local variable or method "acts_as_list"?
Hi, I''m getting the error below, and I''m not sure where to find
"acts_as_list" ...
NameError in SpecialsController#printer
undefined local variable or method `acts_as_list'' for #<Class:
0xb7a46994>
RAILS_ROOT: /usr/local/apache2/htdocs/dps
Application Trace | Framework Trace | Full Trace
vendor/plugins/trunk/lib/scope_out.rb:70:in
2008 Sep 24
5
Re: save blob to file?
Frederick Cheung wrote:
> On 14 Aug 2008, at 15:11, John Griffiths wrote:
>
>>
>> hope someone can help with this,
>>
>> in my mysql table i''ve got a blob column storing images inside the
>> database, it''s also got the filetype and filesize.
>>
>> now i can work out what the filename will be (e.g. 2002.jpg) but i
>>
2008 Nov 05
4
select in form - best practice?
Q. What resource do readers recommend for referencing regarding best
practices for form construction in Rails?
I have the following situation: location_type of Locations may have one
of five (5) possible codes. Presently I have these codes listed in a
drop-down select constructed thusly:
<p>
<b>Location type</b><br />
<%= f.select :location_type,
2008 Oct 06
4
what is Driver & what is Adapter ?
what is Driver & what is Adapter ?
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
2009 Feb 20
6
rails 2.2.2 does not work with ruby 1.9.1
Hi everyone! I''ve installed new Ruby 1.9.1 from sources
(http://www.ruby-lang.org/en/), then "gem install rails", everything was
ok during installation, all tests ("make test") were ok too.
After all, i wanted to create my new RoR project, but I could not start
it.
Plz help me
Here is my terminal:
[renat@localhost rails]$ rails mysite
create
create
2008 Dec 03
5
How to test a plugin
Guys,
I''ve created a plugin, i wanna put my automated test there.
However, I got bad file descriptor error when i run the test like normal
unit test file:
"ruby plugins/acts_as_fox/test/acts_as_fox_test.rb"
How to test a plugin?
Also, is it right to say that I should only put my unit tests (but not
functional test for example) for the plugin in the plugin test folder?
2009 Apr 07
12
Problem with MYSQL after re-installing rails
Hey all-
Re-installed OSX yesterday and with it, Ruby and Rails
Now when I try to run db:migrate I get the error message:
"!!! The bundled mysql.rb driver has been removed from Rails 2.2.
Please install the mysql gem and try again: gem install mysql.
Rake aborted!
no such file to load -- mysql"
So, I try sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
And get:
2008 Dec 02
4
Am I wrong or is fields_for not working right in Rails 2.2.2
I may be totally wrong about what the fields_for method is supposed to
do, but for some reason I thought using it scoped an object around an
association.
For example, I have a User class and when you''re creating a new user I
want to use fields_for to add a BillingAddress to the user like so:
<%- fields_for :billing_address do |billing_address_form| -%>
<%= render :partial