hi all, i am getting an error ''undefined method ''current'' for 852:Fixnum'', the error coming for following line <%if @expert_pagination.current.previous%> <a href="#" class="darkgray1" onclick="paginate_exp(<%=@expert_pagination.current.previous.number%>,escape(''<%=@search_name%>''));"> <img border="0" src="/images/left_arrow.gif" align="absmiddle"></a> <%else%> <%end%> can anyone know why it is coming ? i am using Ruby 1.8.6,rails :2.3.11 and gem 1.6.2 -- Sachin -- 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.
On 28 February 2012 11:26, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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... -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Feb 28, 2012 at 5:06 PM, Michael Pavling <pavling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 28 February 2012 11:26, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 one more condition is there as same above ''@book_pages.current.previous'' here it is getting the value in number (1,2,3,4) here also it is given same error. -- -- 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.
On 28 February 2012 11:53, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Tue, Feb 28, 2012 at 5:06 PM, Michael Pavling <pavling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> On 28 February 2012 11:26, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 objectNo 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> one more condition is there as same > above > ''@book_pages.current.previous'' here it is getting the value in number > (1,2,3,4) > here also it is given same error. > > -- > > > -- > 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.-- gplus.to/clanlaw -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Feb 28, 2012 at 5:31 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 28 February 2012 11:53, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > On Tue, Feb 28, 2012 at 5:06 PM, Michael Pavling <pavling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > >> > >> On 28 February 2012 11:26, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > 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 > > > one more condition is there as same > > above > > ''@book_pages.current.previous'' here it is getting the value in number > > (1,2,3,4) > > here also it is given same error. > > > > -- > > > > > > -- > > 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. > > > > -- > gplus.to/clanlaw > > -- > 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. > >yes it is number ,but when the number is like 6,7 it is giving an error ''''undefined method ''current'' for 852:Fixnum'''' -- Sachin -- 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.
On 29 February 2012 05:22, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Tue, Feb 28, 2012 at 5:31 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> On 28 February 2012 11:53, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > >> > >> > On Tue, Feb 28, 2012 at 5:06 PM, Michael Pavling <pavling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> > wrote: >> >> >> >> On 28 February 2012 11:26, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> >> 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-/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 Wed, Feb 29, 2012 at 1:57 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 29 February 2012 05:22, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > On Tue, Feb 28, 2012 at 5:31 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > >> > >> On 28 February 2012 11:53, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > >> > > >> > > >> > On Tue, Feb 28, 2012 at 5:06 PM, Michael Pavling <pavling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> > wrote: > >> >> > >> >> On 28 February 2012 11:26, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> >> 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-/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. > >colin, i am new to ROR ,the scenario is like that if goto Url www.sugestica.com:8881 and in search on home page if searched using latest suggestions it will give me error and also i said before that the error is coming for ''@book_pages.current. previous'' which is getting the value from controller.i debug and found that it getting value number single digit 6 suppose . i think now you are clear what i am asking for.I just want to know the cause of this error undefined method `current'' for 6:Fixnum -- sachin -- 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.
On 29 February 2012 09:26, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> ''@book_pages.current. > previous'' which is getting the value from controller.i debug and found that > it getting value number single digit 6 > suppose . > > i think now you are clear what i am asking for.I just want to know the cause > of this error > undefined method `current'' for 6:FixnumYes, the error is (as has been said several times already) that something you think should be an object with the method .current, is actually a number "6"... look at where you populate @book_pages. -- 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.
On 29 February 2012 09:26, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Wed, Feb 29, 2012 at 1:57 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> On 29 February 2012 05:22, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > >> > >> > On Tue, Feb 28, 2012 at 5:31 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> >> > wrote: >> >> >> >> On 28 February 2012 11:53, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> >> wrote: >> >> > >> >> > >> >> > On Tue, Feb 28, 2012 at 5:06 PM, Michael Pavling <pavling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> >> > wrote: >> >> >> >> >> >> On 28 February 2012 11:26, sachin kewale <sachinkewale-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> >> >> 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-/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. >> > > colin, i am new to ROR ,the scenario is like that if goto Url > www.sugestica.com:8881 and in search on home page if searched using latest > suggestions it will give > me error and also i said before that the error is coming for > ''@book_pages.current. > previous'' which is getting the value from controller.i debug and found that > it getting value number single digit 6 > suppose . > > i think now you are clear what i am asking for.I just want to know the cause > of this error > undefined method `current'' for 6:FixnumThe cause of the error is simple. 1. @book_pages is the number 6. 2. You have the code @book_pages.current 3. This is the same as saying 6.current 4. The number 6 does not have a method called current 5. Therefore there is the error that the method ''current'' is not defined for the number 6. Now if your question is ''why is @book_pages the number 6'' then you must look at the code where you setup @book_pages. I think you would be better to work through some tutorials first however. I suggest that you forget what you are doing for a few days and work right through something like railstutorial.org, which is free to use online. Then you will have a better grasp of the fundamentals of RoR and will be able to answer your own questions. 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-/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.