Forum: Ruby on Rails Why would @params[:page] >= 2 give an error?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
softwareengineer 99 (Guest)
on 2006-02-07 03:59
(Received via mailing list)
Can anyone please guide me as to what is wrong with the following?

      if @params[:page] >= 2
          @title+=@params[:page]
      end

  Thanks
  Frank
James L. (Guest)
on 2006-02-07 04:02
(Received via mailing list)
On 2/6/06, softwareengineer 99 <removed_email_address@domain.invalid> wrote:
> Can anyone please guide me as to what is wrong with the following?
>
>      if @params[:page] >= 2
>          @title+=@params[:page]
>      end

The error you're getting is ... ?
Kent S. (Guest)
on 2006-02-07 04:05
(Received via mailing list)
Could it be

if @params[:page].to_i >= 2

Kent
softwareengineer 99 (Guest)
on 2006-02-07 18:39
(Received via mailing list)
Kent,
  This may be the answer. I will test it out

  thanks
  Frank

Kent S. <removed_email_address@domain.invalid> wrote:  Could it be

if @params[:page].to_i >= 2

Kent
This topic is locked and can not be replied to.