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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:32:06+00:00 2026-05-27T00:32:06+00:00

In my view page, i am using form_tag to create a form which will

  • 0

In my view page, i am using form_tag to create a form which will pass a string of ids from a hidden field to the controller code.

In my controller code, i am looping through an array of ids to update each record containing that id in the Expression table. But the code below does not seem to work.
I would really appreciate it if somebody could give me some suggestion regarding what is wrong with the code below.

def update_expression
  @emi_ids_array = params[:emi_ids].split(/,/)
  @sub_id = params[:sub_id]

  @emi_ids_array.each do |emi_id|
    @existing_exp = Expression.find(:first, :conditions => [ "EXT_EMI_ID = ? and EXT_SUB_FK = ?", emi_id, @sub_id])
    @expression = @existing_exp.update_attributes(
      :EXT_SUB_FK => @sub_id,
      :EXT_PRESENCE => "present",
      :EXT_STRENGTH => "weak",
      :EXT_EMI_ID => emi_id
    )
  end
end
  • 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-27T00:32:07+00:00Added an answer on May 27, 2026 at 12:32 am

    Found a temporary solution. ‘update_attributes’ does not seem to work, so i opted for ‘update_all’ attribute

     Expression.update_all({:EXT_PRESENCE => "present", :EXT_STRENGTH => "weak"},['EXT_EMI_ID = ? and EXT_SUB_FK = ?', emi_id, @sub_id])
    

    Hopefully, it might be useful to someone else

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

Sidebar

Related Questions

I'm trying to create a page by using view 2. This page list all
In my app I have been using page and form modal view controllers like
I have a view using a master page that contains some javascript that needs
I am using the Model-View-Presenter pattern for a web page. Should the presenter be
I using coda slider in my page. View it here: http://www.ndoherty.com/demos/coda-slider/1.1.1/ Each tab causes
Using ASP MVC and Entity Framework. In the view, you have a page declaration
My view page has a Model which is represented by a List of Students.
While rendering the view page, based on some condition in the controller action I
I have a simple form on a view page, implemented as a user control,
In my page I have a form tag which submits to server, gets data

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.