Im incorporating ajax / javascript stuff for the first time in my
project and im a bit confused by all various methods available, rjs,
prototype, javascript etc so please excuse me if this is an obvious
question.
Whilst looping though an array of model objects in my view I want to be
able to show or hide a div that contains the message "Your list is
empty".
so something like this
<% if items.empty?>
#the following is not the correct way
$('no-items-msg').show
<% else >
$('no-items-msg').hide
<% items.each do |item|%>
render :partial => "item_rows"......
<%end%>
how do i add the prototype stuff correctly?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---