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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:08:22+00:00 2026-05-19T12:08:22+00:00

My objective is to allow Admins the right to sign Users up for a

  • 0

My objective is to allow Admins the right to sign Users up for a Project.

Currently, Users can sign themselves up for Projects.

So I was thinking in order to allow Admin to do this.. do something like this :

haml

= link_to "Project Signup", card_signups_path + "?user=#{user.id}", :class => "button"

And pass the params[:user] so I can replace this controller with this :

if params[:user]
  @card_signup = User.find(params[:user]).build_card_signup
else
  @card_signup = current_user.build_card_signup
end

The trouble is though.. this is a 3 part signup process, and its loaded VIA AJAX, so I can’t pass the ?user=#{user.id} in any of the steps after the first.. ( at least not by the same convention that I already did, or know how to )

What kind of strategy would you employ in this?

  • 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-19T12:08:23+00:00Added an answer on May 19, 2026 at 12:08 pm

    One possible way of accomplishing this, would be to add a hidden field to your form, that mirrors the parameter your passing in, if its found.

    So if the parameter your passing in is user, in your view you want to add a hidden field something like:

    <input type="hidden" name="user" and value="<%= params[:user] %>" />

    or with a rails form helper:

    hidden_field_tag 'user', params[:user]

    This way the code in your controller can check for this parameter at each step on the receiving end and know who to save the object for. Something like this:

    def create 
       @card_signup = CardSignup.new(params[:card_signup])
       if params[:user] && params[:user].to_i > 0
         ##
         ##some logic here to make sure current_user is admin, as no one else is allowed to do this
         ##
         @card_signup.user_id = params[:user]
       else
         @card_signup.user_id = current_user.id
       end
       ##onto validating model and saving / redirecting / etc
    end
    

    But the ultimate goal here is to keep the user param around, whether its an initial GET parameter to the page, or a Put/Post from ajax/etc to submit the form, this parameter will be around.

    One other security angle to check would also be in the ‘new’ action of this controller, and check that if the user param is present then the current_user is an administrator, otherwise redirect or display an error message. This combined with re-validating this on the create should provide a decent way of making sure no one else can make these requests. You could also put this in a before_filter and call it for only new and create to keep things clean.

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

Sidebar

Related Questions

Objective : Make a progress bar where users can check how much of a
This is driving me nuts so I hope someone can help an Objective-C noob
In Java, you can make an enum having multiples values. In objective-C, this cannot
My objective is to allow users of my app to bringup what I'm calling
I currently have the following javascript code (loosely modeled after how a similar objective
I know that there are functions in the objective-c runtime that allow you to
I am working on an app to allow users to log in to our
I need to find out how I can allow our Sharepoint portal to support
I want to allow users to create their resume online. Resume creation will have
In objective-c, I can do something like @interface MyViewController : UIViewController <UITextInputDelegate> to create

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.