-1

i am create scaffolding using Rails. This is my index page

    <%- model_class = Tasktodo -%>
<div class="page-header">
  <h1><%=t 'title', :default => model_class.model_name.human.pluralize %></h1>
</div>
<table class="table table-striped">
  <thread>
    <tr>
      <th><%= model_class.human_attribute_name(:id) %></th>
      <th><%= model_class.human_attribute_name(:name) %></th>
      <th><%= model_class.human_attribute_name(:tname) %></th>
      <th><%= model_class.human_attribute_name(:created_at) %></th>
      <th><%=t '.actions', :default => t("helpers.actions") %></th>
    </tr>
  </thead>
  <tbody>
<div id="edit">
    <% @tasktodos.each do |tasktodo| %>
      <tr>
        <td><%= link_to tasktodo.id, tasktodo_path(tasktodo) %></td>
        <td><a href="#" onclick="inedit()" style="text-decoration:none"><%= tasktodo.name %></a></td>
        <td><%= tasktodo.tname %></td>
        <td><%=l tasktodo.created_at %></td>
        <td>
</div>

<%= link_to t('.edit', :default => t("helpers.links.edit")),
                      edit_tasktodo_path(tasktodo), :class => 'btn btn-mini' %>

If i clicked Edit button means.it will be go to edit page like next page.. now i want to do operation without server hit.means don't go nextpage when i clicked. all operation should be done in same page only. using Ajax,how can i do this operation.?

Ananth
  • 13
  • 5
  • You can achieve that by doing `inline editing` or take a edit form partial with in the index page, and update from there. – VenkatK Dec 13 '12 at 11:55
  • It is an open answer question, there is a variety of approaches to do this. – Pavel S Dec 13 '12 at 12:15

1 Answers1

0

Best I can offer is this link http://guides.rubyonrails.org/ajax_on_rails.html

Follow it through and you'll be able to build a CRUD scaffhold using RoR and JQuery (with Ajax)

Hope this helps

David Sigley
  • 1,126
  • 2
  • 13
  • 28