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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:52:10+00:00 2026-05-31T14:52:10+00:00

In my application, I’ve a ‘ warehouse ‘ model that own several fields such

  • 0

In my application, I’ve a ‘warehouse‘ model that own several fields such as id,name,description, etc, and a boolean field called ‘done’.

In my view, I want to insert a button or link field,which, when clicked, should set (through HTTP POST method) warehouse.done = true
How can I do this?

Notes: User cannot input warehouse.done field so I suppose to pass it to application as hidden field

  • 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-31T14:52:12+00:00Added an answer on May 31, 2026 at 2:52 pm

    I made a couple of assumptions on the views, controller.

    html

    <a href="#" id="set-warehouse-done"> DONE </a>
    <input id="warehouse-id" type="hidden" value="24">
    

    js

    $(document).ready(function() {
      $('#set-warehouse-done').click(function() {
        $.ajax({
          url: '/warehouse/' + $('#warehouse-id').attr('value');
          type: 'POST'
          data: done: true
        });
      });
    }
    

    warehouse_controller.rb

    def update
      @warehouse = Warehouse.find(params[:id])
      if params[:done]
        if @warehouse.update_attributes(:done, params[:done])
          flash[:notice] = 'Warehouse updated successfully'
        else
          flash[:error] = 'Could not update warehouse'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Application frameworks such as DotNetNuke, Eclipse, Websphere and so forth are available today which
Application : HTA (therefore IE) This is an application that uses SendKeys to populate
Application I work on generates several hundreds of files (csv) in a 15 minutes
my application use 10 threads that to read a lot of html file.similar the
Application shows information about planets, their moons, and etc. It shows a list of
APPLICATION DESCRIPTION : I am a new iPhone developer. I am working on an
Application use NHibernate. I Have object A that contains set of objects B. I
My application has to detect that the device connected to the Wi-Fi network is
Application db connection in web service. i haveto connect the db using that web
My application is suspending on a line of code that appears to have nothing

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.