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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:06:02+00:00 2026-05-13T06:06:02+00:00

I am trying to identify a user ID number, to grab a Student row

  • 0

I am trying to identify a user ID number, to grab a Student row from an ActiveRecord table, but for some reason the ‘post’ block won’t find my :id.

For the ‘get’, the url is localhost:9456/update/17. It’s this 17 I need to pass to the ‘post’ block to update the database.

I am not sure how to do this. Parse the URL? It seems like I am missing something obvious.

# update user page
get '/update/:id' do
  @student = Student.find(params[:id]) #this returns ID=17
  erb :update
end

#update user submit
post '/update' do
  @student = Student.find(params[:id])  #this line doesn't work
  @student.name = (params[:name])
  @student.email = (params[:email])
  @student.save
  redirect '/'
end

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-13T06:06:03+00:00Added an answer on May 13, 2026 at 6:06 am

    Are you actually passing the id back? Are you submitting a form via POST? If so, all you should need to do is add an input whose name attribute is id.

    <form action='/student/update' method='post'>
      <input type='hidden' name='id' value='17' />
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to identify if the user has typed someone else's username if the
I am trying to get a user's timezone. I can do this, but how
Hello. I'm trying to add an avatar to the user, but when booting I
I'm trying to update a column in table Profiles with a COUNT from another
I'm trying to identify proper nouns in a user-submitted 3-4 sentence paragraph. I'm OK
am trying to implement a multiuser communication app. I want to identify a user's
I am trying to identify file types for directory entries (Windows Unix etc..). In
I am trying to identify all the nodes in a tree that lead to
I am trying to identify SQL INSERTS that occur when a record is viewed
I'm trying to identify when a particular process is running, based on its arguments,

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.