hi, i am using popup box for alert for repeated items with some dynamic values to display in my popup i have saved all values in @employee variable and when it call pop using button click it does''t shows me data that is in @employee like <div id="popup"> Employee list filtered <% @employee.each do |emp|%> name <%= emp.name%> department <%= emp.dept %> <% end %> </div> only "Employee list filtered" is seen in popup on other dynamic values are not displayed in it could any one provide me solution ? thanks, -pab -- 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 4 October 2011 14:15, Pab <prabu.net88-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hi, > > > i am using popup box for alert for repeated items with some > dynamic values to display in my popup > i have saved all values in @employee variable and when it call pop > using button click it does''t shows me data that is in @employee > like > <div id="popup"> > Employee list filtered > <% @employee.each do |emp|%> > name <%= emp.name%> > department <%= emp.dept %> > <% end %> > </div> > > only "Employee list filtered" is seen in popup on other dynamic > values are not displayed in it > could any one provide me solution ?You could include some more diagnostics in your output, for example, before the ''each'' loop try displaying @employee.size to see if there is anything there. The symptom suggests that it is empty. Also have a look at the Rails Guide on debugging, in particular how to use ruby-debug to break into your code to inspect data and follow flow. If you find that @employee.size is 0 then break into the controller code that sets it up to see what is going on. 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.
What does the value of your @employee variable look like. Where do you assign it? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/m94o6iq5IUEJ. 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.
hi, I assigned it my controller like @employee = Employee.find(:all,:conditions => ["exp =?",params[:exp]]) i tried it by putting each loop in controller and it workes well, but in case of popup box its not working and also @employee.size is also not displayed in popup thanks, -pab -- 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 4 October 2011 15:11, Pab <prabu.net88-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hi, > > I assigned it my controller like > @employee = Employee.find(:all,:conditions => ["exp =?",params[:exp]])Did you try removing the :conditions so it is just .find(:all) to see what happens? By the way, you should really call it @employees so you know it is a collection not just one employee.> > i tried it by putting each loop in controller and it workes well, but > in case of popup box its not working > and also @employee.size is also not displayed in popupWhat do you mean it is not displayed, if you do size: <%= @employee.size %> what do you see? What did you learn by using ruby-debug and breaking into the controller code? Colin> > thanks, > -pab > > -- > 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.
well it will show the size of the array.. -- 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 7 October 2011 07:56, Pab <prabu.net88-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > well it will show the size of the array..Is that supposed to be an answer to one of the questions previously asked? You have given no indication of which one, nor have you answered some other questions. Please reply again to whichever post you are replying and insert your message inline at appropriate points in the previous post so that we can see what you are replying to. 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.
there is no problem with my code if i try that with some partial page, data listed perfectly, but only in case of popbox data is not displayed thanks -pab -- 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.