views:

80

answers:

1

I managed to get Ajax working in Rails, specifically using remote_form_for tag to add Todos from Index. However when I do add them, there is a bullet mark next to them.

Here's my post/index

<% form_remote_tag(   :url =>
todos_path, :method => :create,  
:update => "todo_list", :position =>
:top,   :html => {:id => 'todo_form'})
do %>

<label for="todo_title">Todo</label>
<%= text_field( "todo", "title") %>

<button type="submit">Add
Todo</button> <% end %> </div> <div
id="todo_list"></div> <br />

And my partial _todo

<li id="todo_"><%= link_to todo.title, :action => 'show'%></li>

When I click Add, it adds a new todo with a bullet mark next to it.

Any help?

+1  A: 

I know neither ruby nor rails, but to get rid of unwanted bullet points in lis you use the following CSS:

ul
{
  list-style-type: none;
  margin: 0px;
  padding: 0px;
 }
Pekka
yes. the bullets don't really have anything to do with rails.
Peter
That did the trick...I didn't notice, but it was using <li>. Changed it to <ul> and added what you said in css and it worked. Thanks a lot!
Senthil
You're welcome. Just beware that `<ul>` is the surrounding structure around your `<li>`s and should not stand alone!
Pekka
Ah that makes perfect sense...Thanks again.
Senthil