Wednesday, February 29, 2012

Re: [Rails] getting error:undefined method 'current'

On 29 February 2012 05:22, sachin kewale <sachinkewale@gmail.com> wrote:
>
>
> On Tue, Feb 28, 2012 at 5:31 PM, Colin Law <clanlaw@googlemail.com> wrote:
>>
>> On 28 February 2012 11:53, sachin kewale <sachinkewale@gmail.com> wrote:
>> >
>> >
>> > On Tue, Feb 28, 2012 at 5:06 PM, Michael Pavling <pavling@gmail.com>
>> > wrote:
>> >>
>> >> On 28 February 2012 11:26, sachin kewale <sachinkewale@gmail.com>
>> >> wrote:
>> >> >    i am getting an error 'undefined method 'current' for 852:Fixnum',
>> >> > the
>> >> > error coming for following line
>> >> >
>> >> > <%if @expert_pagination.current.previous%>
>> >>
>> >> ....and the value of @expert_pagination is what? Have you debugged it
>> >> to
>> >> see?
>> >> I assume you expect it to be an object of some sort with a method
>> >> ".current"; but the error is telling you that it's a Fixnum...
>> >>
>> >
>> > yes the @expert_pagination is object
>>
>> No it is not an object, it is a number.  Have a look at the Rails
>> Guide on Debugging to get ideas on how to work out what is going on.
>>
>> Colin
> ...
>
> yes it is number ,but when the number is like 6,7 it is giving an error
> ''undefined method 'current' for 852:Fixnum''

I don't understand what you are saying, you accept that
@expert_pagination is a number, but then expect to be able to say
@expert_pagination.current. A number does not have a method current
so the error is shown. What do you expect @expert_pagination.current
to do if @expert_pagination is a simple number?

I also don't understand what you mean by "when the number is like 6,7"
6,7 is not a number, or do you mean 6.7?

Have you followed my earlier suggestion to read the Rails Guide on
debugging in order to find out what is going on? Please answer this
question if you reply, do not just ignore it.

Colin

--
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@googlegroups.com.
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate