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

The Archive Base Latest Questions

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

this is how I display the user’s email in my dropdown <%= collection_select(:user, :id,

  • 0

this is how I display the user’s email in my dropdown

     <%= collection_select(:user, :id, User.all(:conditions => ["company_name=?", $company]), :user_id, :email, :prompt=>'Select a User') %>

this is the parameters being generated:

      Parameters: {"commit"=>"Submit", "utf8"=>"✓", "from_date"=>"December 7, 2011 6:45 AM", "to_date"=>"December 9, 2011 7:45 AM", "user"=>{"user_id"=>"12"}}

Once hitting the submit button it has to display the details with the help of user_id and my index function of the controller looks like this

      def index
      if (!params[:user][:user_id].nil?)
         user_id = params[:user][:user_id]
         else
        user_id = current_user.id
       end

But I get an error like this:

       You have a nil object when you didn't expect it!
       You might have expected an instance of Array.
       The error occurred while evaluating nil.[]

What could be wrong please help
thanks in advance

  • 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-27T09:32:41+00:00Added an answer on May 27, 2026 at 9:32 am

    if params[:user] is nil the “params[:user][:user_id].nil raise exeption” need:

    unless params[:user].nil? and params[:user][:user_id].nil?
    ....
    else
    ....
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this script to display all the images in a folder, but I
Currently I display user's location at MapView: MyLocationOverlay myLocationOverlay = new MyLocationOverlay(this, mapView); mapView.getOverlays().add(myLocationOverlay);
I have a TextBlock that I want to display a user name, and email
Currently i have url parameters like this http://www.website.com/index.php?user&page=edit And in index.php i have set
I've got this simple function which displays a message to the user. If I
In my XAML file I want to display this text which contains double and
I got this Base64 gif image: R0lGODlhDAAMALMBAP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAACH5BAUKAAEALAAAAAAMAAwAQAQZMMhJK7iY4p3nlZ8XgmNlnibXdVqolmhcRQA7 Now I want to display this
Any suggestions on the best way to display this table on an Android platform?
I have the following number: 4.3 I'd like to display this number as 4,3
I created a Loading spinner in a SWF. I display this spinner in my

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.