Hi all! I want to add alert message via jquery when User clicks <div
id="star">star</div>.
But, It can't work.
Please teach me some advice.

Thanks!

# posts/index.html.erb

[code]
...
<% @posts.each do |post| %>
  <tr>
    <td><%= post.id %></td>
    <td><%= post.content %></td>
    <td></td>
    <div id="like">
      <td>like</td>
    </div>
    <td><div id="star">star</div></td>
    <td><%= post.created_at.strftime("%Y年%m月%d日%H:%M:%S") %></td>
<% end %>
</tr>
</table>

....
[/code]

# application.js
[code]
$(document).ready(function() {
   $("#star").click(function(){
     alert("add_star");
   })
 });
[/code]

-- 
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.

Reply via email to