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

  • Home
  • SEARCH
  • 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 597415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:16:41+00:00 2026-05-13T16:16:41+00:00

I have a custom route: map.resources :user_requests, :member => {:confirm => :any} I have

  • 0

I have a custom route:

map.resources :user_requests, :member => {:confirm => :any}

I have two methods in my Request controller for this purpose:

def confirm   
x = current_user.contact.contactable
@requests = UserRequest.find(:all, :conditions => ["location_id = ?", x]) #The results from this display in dropdown list.
end

def update_confirm
UserRequest.transaction do
@request = @requests.find params[:id] #Here I just want to grab the option they choose from dropdown.
@request.created_at = Time.now
if @request.save
x = @request.student_id
y = @request.id
books = Book.find(:all, :conditions => ["book.location_id = ? && book.request_id = ?", x, y])
books.each do |book|
  book.book_state_id = 3
  book.save
end
end
end
end

And the view confirm.erb:

<%  form_for(:user_request, :url => {:action => :confirm}) do %>
Request: <%= select_tag(:id, options_from_collection_for_select(@requests, :id, :request_status_id)) %> <br /> 
Password: <%= password_field_tag :password  %> <br />
 <%= submit_tag 'Confirm Request' %>
<% end %>

The updating occurs in the update_confirm action, so my question is after user picks an option from confirm action, when they click to submit the form, I would like to trigger the update_confirm action from the confirm page. Any suggestions? Thanks.

  • 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-13T16:16:42+00:00Added an answer on May 13, 2026 at 4:16 pm

    Easy, just check for request method:

    def confirm
      if request.post?
        update_confirm
       end
      # ...
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two routes in my area, one custom and one default fallback route,
I have used this code to animate the circle along a fixed custom route
I have this custom route in my routes.rb match '/businesses/:permalink', :to => 'businesses#show', :as
I have a custom routing application that takes information for a route from google
I have custom classes that I currently instantiate within App.xaml as resources. I want
I have custom map image with specific height and width. i need to map
I have implemented a custom route (inherit from RouteBase) to have dynamic routes based
I have a custom info window over a google map, sometimes these info windows
I've never created a custom route before, but I finally have a need for
I'd like to have one route that gives the option of two urls but

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.