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 7766507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:26:11+00:00 2026-06-01T15:26:11+00:00

this is my view: @bulk_objects.each do |bulk_warehouse| bulk_error = @wh_errors[:bulk_warehouse#{@count}] if @wh_errors -%> <tr

  • 0

this is my view:

 @bulk_objects.each do |bulk_warehouse|
      bulk_error = @wh_errors[:"bulk_warehouse#{@count}"] if @wh_errors      
-%>
<tr class="<%= cycle("odd", "even") %>">
             <%= hidden_field_tag("bulk_warehouse_id#{@count}",bulk_warehouse.id) %>
               <td><%= text_field_tag("bulk_warehouse_asset#{@count}", bulk_warehouse.asset, :disabled => true)%></td>
              <td><%= text_field_tag("bulk_warehouse_serial#{@count}", bulk_warehouse.serial, :disabled => true) %></td>



              <td><%= check_box_tag "enable_record#{@count}",1,false,{:onclick => "bulk_warehouse_asset#{@count}.disabled = 
                                                                                bulk_warehouse_serial#{@count}.disabled = 
                                                                                !this.checked;"}%></td>



                    <td class="last">
                <%= link_to "#{t("web-app-theme.delete", :default => "Delete")}", bulk_warehouse_path(bulk_warehouse), :method => :delete, :confirm => "#{t("web-app-theme.confirm", :default => "Are you sure?")}" %>
              </td>


            </tr>
          </div>          
    <%  @count = @count +1 %>
 <% end -%>
      </table>
       <div class="actions-bar wat-cf">
    <div class="actions">
    </div>
 ..

and this is my controller:

 @bulk_objects = BulkWarehouse.all
                         @count= @bulk_objects.count

Now I would add in my view a “Select all” checkbox that when you click on it enables all other “enable_record#{@count}” checkbox. I know that this thing should be done using Ajax and Jquery but I don’t know how. Anyone can help me?
Thank you ll

  • 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-06-01T15:26:13+00:00Added an answer on June 1, 2026 at 3:26 pm

    You can use button_to_function to create a button that will check/uncheck all the boxes on the form.

    Place this code in your view, where you want your check/uncheck button to go. When the button is clicked, it will run the toggleChecked javascript function.

    <%= button_to_function "Check / Uncheck All", "toggleChecked()" >
    

    Place your javascript code at the bottom of your view.

    <script type='text/javascript'>
        var toggleChecked = function() { $('input[type="checkbox"]').click(); });
    </script>
    

    The function also can be put into the respective .js file in assets/javascripts.

    That should get you up and running.

    ————— UPDATE ——————

    Button_to_function is now deprecated. I recommend handling this using an HTML5 button and jQuery.

    View code for your button:

    <button type="button" id="check_all">
        Check / Uncheck All
    </button>
    

    Javascript:

    <script type='text/javascript'>
        $('#check_all').on("click", function(){ $('input[type="checkbox"]').click(); });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've defined a class MarkerView which extends ImageView and to use this View, I
I want to implement this view But I have one question: The text which
I created a new View (LogView) in Infrastructure.Module project. This view will be used
I have a Django view called change_priority. I'm posting a request to this view
I'm displaying a UIView with a UILabel on it and this view&label become blurry
I have a view ViewUserControl<SearchViewData> where SearchViewData: CommonViewData In this view I thus have
I got a view that inherits : System.Web.Mvc.ViewPage<IEnumerable<MyProjects.Models.MyAccountWrapper>> In this view I list data
I'm having a memory problem related to UIImageView. After adding this view to my
I have a nicely working custom CursorAdapter with customized ListView. This view allows the
I Currently have this view as scripted below. The problem is I cannot find

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.