【问题标题】:Rails/Ajax: Unable to remove "bullet mark" when using Ajax in Rails to add Todos remotelyRails/Ajax:在 Rails 中使用 Ajax 远程添加 Todos 时无法删除“项目符号”
【发布时间】:2009-12-22 08:07:02
【问题描述】:

我设法让 Ajax 在 Rails 中工作,特别是使用 remote_form_for 标签从 Index 添加 Todos。但是,当我添加它们时,它们旁边有一个项目符号。

这是我的帖子/索引

<% 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 />

还有我的部分 _todo

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

当我点击添加时,它会添加一个新的待办事项,旁边有一个项目符号。

有什么帮助吗?

【问题讨论】:

    标签: ruby-on-rails css ajax


    【解决方案1】:

    我既不知道 ruby​​ 也不知道 rails,但要摆脱 lis 中不需要的要点,您可以使用以下 CSS:

    ul
    {
      list-style-type: none;
      margin: 0px;
      padding: 0px;
     }
    

    【讨论】:

    • 是的。子弹与铁轨没有任何关系。
    • 成功了……我没注意到,但它使用了
    • 。将其更改为
        并添加了您在 css 中所说的内容,并且有效。非常感谢!
  • 不客气。请注意&lt;ul&gt; 是您的&lt;li&gt;s 周围的结构,不应单独存在!
  • 啊,这很有道理...再次感谢。
  • 猜你喜欢
    相关资源
    最近更新 更多
    热门标签