[Rails] Re: each do js problem

2011-08-04 Thread Neil Bye
Sorry still stuck. If you look at the attached _subcomment.html.erb you will see that I have put the jQuery inside the each loop and it obviously causes problems because the jQuery is repeated. It's inside because I get an error on the comment variable otherwise. Any ideas Neil Attachments:

[Rails] Re: each do js problem

2011-08-03 Thread Frederick Cheung
On Aug 2, 12:22 pm, Neil Bye li...@ruby-forum.com wrote: Neil Bye wrote in post #998024: Jeffrey L. Taylor wrote in post #997862:  div id=%= remark_#{comment[:id]} % I rebuilt the app in Rail 3 and the above no longer works. Has anybody an idea why? Or What can I use instead? How has

[Rails] Re: each do js problem

2011-08-03 Thread Neil Bye
Frederick Cheung wrote in post #1014673: On Aug 2, 12:22pm, Neil Bye li...@ruby-forum.com wrote: Neil Bye wrote in post #998024: Jeffrey L. Taylor wrote in post #997862: div id=%= remark_#{comment[:id]} % I rebuilt the app in Rail 3 and the above no longer works. Has anybody an idea why?

[Rails] Re: each do js problem

2011-08-03 Thread Neil Bye
Sorry the attachment is now correct, Id missed out the _#{comment[:id]} Neil Attachments: http://www.ruby-forum.com/attachment/6495/_subcomment.html.erb -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: each do js problem

2011-08-03 Thread Frederick Cheung
On Aug 3, 11:30 am, Neil Bye li...@ruby-forum.com wrote: Sorry the attachment is now correct, Id missed out the _#{comment[:id]} it's not in a %= tag anymore Fred Neil Attachments:http://www.ruby-forum.com/attachment/6495/_subcomment.html.erb -- Posted viahttp://www.ruby-forum.com/.

[Rails] Re: each do js problem

2011-05-10 Thread Eugen Ciur
The subcomments on the first comments subcomments the subcomments on the first comment and has no effect on it's own subcomments lol :) In jquery there is nice method toggle. .toggle( showOrHide ) showOrHideA Boolean indicating whether to show or hide the elements. With no parameters, the

[Rails] Re: each do js problem

2011-05-10 Thread Neil Bye
Eugen Ciur wrote in post #997765: http://api.jquery.com/toggle/ use it, it will simplify you code and maybe you'll find out solution on your own. Never used jquery before, I see it's simplicity compared to straight js I now have % @user.comments.each do |comment| % div id=remark p%=

[Rails] Re: each do js problem

2011-05-10 Thread Neil Bye
Frederick Cheung wrote in post #997768: Is this repeated for each comment? have multiple things on the page with the same id is a no-no: ids should be unique Fred This is the full code % @user.comments.each do |comment| % div id=remark p%= comment.body %/p div id=commenterp%=

Re: [Rails] Re: each do js problem

2011-05-10 Thread Frederick Cheung
On 10 May 2011, at 17:56, Neil Bye li...@ruby-forum.com wrote: Frederick Cheung wrote in post #997768: Is this repeated for each comment? have multiple things on the page with the same id is a no-no: ids should be unique Fred This is the full code % @user.comments.each do

Re: [Rails] Re: each do js problem

2011-05-10 Thread Colin Law
On 10 May 2011 17:56, Neil Bye li...@ruby-forum.com wrote: Frederick Cheung wrote in post #997768: Is this repeated for each comment? have multiple things on the page with the same id is a no-no: ids should be unique Fred This is the full code % @user.comments.each do |comment| %   div

Re: [Rails] Re: each do js problem

2011-05-10 Thread Jeffrey L. Taylor
Quoting Colin Law clan...@googlemail.com: On 10 May 2011 17:56, Neil Bye li...@ruby-forum.com wrote: Frederick Cheung wrote in post #997768: Is this repeated for each comment? have multiple things on the page with the same id is a no-no: ids should be unique Fred This is the