Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Add new user data into another database as well...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bruce  
View profile  
 More options Feb 12, 6:05 pm
From: Bruce <bcacker...@gmail.com>
Date: Sun, 12 Feb 2012 15:05:01 -0800 (PST)
Local: Sun, Feb 12 2012 6:05 pm
Subject: Add new user data into another database as well...
I currently have this as the Registration Controller for Devise

class RegistrationsController < Devise::RegistrationsController

  protected

    def after_update_path_for(resource)
      edit_user_registration_path
    end
end

I want to enter in certain fields (company_name, user_id that was
created) into a database called Company because I want to create
multiple users for each company.

Do you know how to write this in the Devise controller?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Carlos Antonio da Silva  
View profile  
 More options Feb 12, 8:57 pm
From: Carlos Antonio da Silva <carlosantoniodasi...@gmail.com>
Date: Sun, 12 Feb 2012 23:57:40 -0200
Local: Sun, Feb 12 2012 8:57 pm
Subject: Re: [devise] Add new user data into another database as well...

If you're talking about default attributes for your user, you could probably override the `build_resource` method, call super and do whatever you want with it, something like:

    def build_resource(*args)
      resource = super
      resource.company_id = 1 # for instance
      resource
    end

--
At.
Carlos Antonio


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bruce Ackerman  
View profile  
 More options Feb 13, 12:24 am
From: Bruce Ackerman <bcacker...@gmail.com>
Date: Sun, 12 Feb 2012 23:24:13 -0600
Local: Mon, Feb 13 2012 12:24 am
Subject: Re: [devise] Add new user data into another database as well...

Hmm, so this is the best way to do an additional
@company = Company.new(params[:name blah])
@company.save

to the devise controller?

On Sun, Feb 12, 2012 at 7:57 PM, Carlos Antonio da Silva <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Carlos Antonio da Silva  
View profile  
 More options Feb 13, 5:10 am
From: Carlos Antonio da Silva <carlosantoniodasi...@gmail.com>
Date: Mon, 13 Feb 2012 08:10:49 -0200
Local: Mon, Feb 13 2012 5:10 am
Subject: Re: [devise] Add new user data into another database as well...

Everything depends on what you want to achieve. For instance, ff you want to create a company together with the user, given user input, you should probably use nested attributes or something.

--
At.
Carlos Antonio


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bruce Ackerman  
View profile  
 More options Feb 13, 9:41 am
From: Bruce Ackerman <bcacker...@gmail.com>
Date: Mon, 13 Feb 2012 08:41:02 -0600
Local: Mon, Feb 13 2012 9:41 am
Subject: Re: [devise] Add new user data into another database as well...

Hmm thanks

Thanks,
Bruce Ackerman
www.bruceackerman.com

On Mon, Feb 13, 2012 at 4:10 AM, Carlos Antonio da Silva <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »