Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6130989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:55:20+00:00 2026-05-23T16:55:20+00:00

How could you do what’s covered in RyanB’s Railscast on editing multiple records individually,

  • 0

How could you do what’s covered in RyanB’s Railscast on editing multiple records individually, using Formtastic? Formtastic doesn’t use form_tag, which RyanB’s method relies on.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:55:20+00:00Added an answer on May 23, 2026 at 4:55 pm

    The semantic_form_for is just a wrapper around form_for so you can use the same parameters. Here is a formtastic version of Ryan Bates’ screencast

    views/products/edit_individual.html.erb

    <% semantic_form_for :update_individual_products, :url => update_individual_products_path, :method => :put do |f| %>
      <% for product in @products %>
        <% f.fields_for "products[]", product do |ff| %>
          <h2><%=h product.name %></h2>
          <%= render "fields", :f => ff %>
        <% end %>
      <% end %>
      <p><%= submit_tag "Submit" %></p>
    <% end %>
    

    views/products/index.html.erb

    <% semantic_form_for :edit_individual_products, :url => edit_individual_products_path do %>
      <table>
        <tr>
          <th></th>
          <th>Name</th>
          <th>Category</th>
          <th>Price</th>
        </tr>
      <% for product in @products %>
        <tr>
          <td><%= check_box_tag "product_ids[]", product.id %></td>
          <td><%=h product.name %></td>
          <td><%=h product.category.name %></td>
          <td><%= number_to_currency product.price %></td>
          <td><%= link_to "Edit", edit_product_path(product) %></td>
          <td><%= link_to "Destroy", product, :confirm => 'Are you sure?', :method => :delete %></td>
        </tr>
      <% end %>
      </table>
      <p>
        <%= select_tag :field, options_for_select([["All Fields", ""], ["Name", "name"], ["Price", "price"], ["Category", "category_id"], ["Discontinued", "discontinued"]]) %>
        <%= submit_tag "Edit Checked" %>
      </p>
    <% end %>
    

    Please note that you can use the form_for helpers as well in formtastic.

    Update

    If you like to use nested attributes as well it should work out of the box, using fields_for on the form partial. Lets stick with the railscast example and say that:

    product.rb

    has_many :commments
    accepts_nested_attributes_for :comments
    

    You can edit the comments on the _fields.html.erb of the products like:

    <%= f.fields_for :comments do |cf| %>
      <%=render 'comments/fields', :f=>cf%>
    <%end%>
    

    And make sure you have a fields partial in your comments views.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could someone point out good tutorials/books for learning how to use/configure Hibernate in Android
Could you help me plaese! I had to use next jQuery functionality. elem.parents('.CanvasRoot:first').unbind('click').click(function(){ ...
Could we move background image instead of moving div by using css3 animation? For
Could anyone explain to me how to use this library: http://code.google.com/p/neurolab/ to create a
could not deserialize json into objects. try to use DataContractJsonSerializer . here is how
Could anyone post a minimalistic example of drag'n'drop imeplementation using jQuery without using draggable
Could someone please show how i could parse a ics file using NSScanner? (Iphone
could the following code be refactored and simplified by using the collection parameter of
Could you help me please to find a complement of a language, which ends
Could someone give me an example of how to use the ContactPicker.PickSingleContactAsync() functionality correctly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.