[Devise] Display a custom sign_UP form anywhere in your app

Hi!

I know how to display an sign_in form, but now, i’d like to display a
sign_up form in another place of my application.

Have some way to do this?

I can’t find nothing about that on the documentation

thanks!


Fernando A.

Same way you’d display the form any other place I’d imagine…

<%= form_for(User.new, :as => :user, :url => registration_path(:user))
do |f| %>
<%= devise_error_messages! %>
form fields here…
<%= f.submit “Sign up” %>
<% end %>

Dont work.

maybe because I’m already logged in when I try a new register?

On Mon, Jun 13, 2011 at 2:35 PM, Tim S. [email protected] wrote:

You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/M9XgyCg_Z8AJ.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


Fernando A.

[iOSDeveloper] - ObjectiveC
[WebDesigner] - CSS3&HTML5
[WebDeveloper] - RubyOnRails
*--------------------------------------------------------------
*
[portfolio] http://www.fernandoaureliano.com -
[blog]http://www.fernandoaureliano.com/

The form appears, I put the data and go!

Dont show any erros, but the data are not recorded

On Mon, Jun 13, 2011 at 10:27 PM, Tim S. [email protected] wrote:

[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


Fernando A.

[iOSDeveloper] - ObjectiveC
[WebDesigner] - CSS3&HTML5
[WebDeveloper] - RubyOnRails
*--------------------------------------------------------------
*
[portfolio] http://www.fernandoaureliano.com -
[blog]http://www.fernandoaureliano.com/

Which part doesn’t work?

I can get the form in another view with the code below.

But when insert the data and submit, the user is not recorded in
database

<%= form_for(User.new, :as => :user, :url => registration_path(:user))
do
|f| %>

<%= f.label :email %>
<%= f.email_field :email %>

<%= f.label :password %>
<%= f.password_field :password %>

<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation %>

<%= f.submit "Sign up" %>

<% end %>

On Tue, Jun 14, 2011 at 4:37 AM, Colin L. [email protected]
wrote:

Colin


Fernando A.

On 14 June 2011 03:00, Fernando A. [email protected]
wrote:

The form appears, I put the data and go!
Dont show any erros,but the data are not recorded

Have a look in development.log to check that the data are being posted
correctly and it is going to the correct action. Then if all looks ok
use ruby-debug to break into your code and see what is going on. Have
a look at the Rails Guide on debugging to find how to do this.

Colin

Hi!

First user (admin) I already register.

It’s a security question. If I leave the registration page open,
everyone
can find that and register yourself on admin, and have access…

=D

On Thu, Jun 16, 2011 at 6:10 PM, Colin L. [email protected]
wrote:

<%= f.password_field :password %>

The form appears, I put the data and go!
You received this message because you are subscribed to the Google

http://groups.google.com/group/rubyonrails-talk?hl=en.


Fernando A.

On 16 June 2011 20:52, Fernando A. [email protected]
wrote:

I can get the form in another view with the code below.
But when insert the data and submit, the user is not recorded in database

I can only repeat my previous post exactly:
Have a look in development.log to check that the data are being posted
correctly and it is going to the correct action. Then if all looks ok
use ruby-debug to break into your code and see what is going on. Have
a look at the Rails Guide on debugging to find how to do this.

Colin

Ha!

I found a problem. The problem is because I try to register a user while
I’m
logged on

But, how fix this?

On Thu, Jun 16, 2011 at 8:54 PM, Fernando A. <
[email protected]> wrote:

Redirected to http://localhost:3000/admin

It’s a security question. If I leave the registration page open, everyone

I can get the form in another view with the code below.

<%= f.label :password_confirmation %>
> > The form appears, I put the data and go! > You received this message because you are subscribed to the Google

To unsubscribe from this group, send email to
[email protected]


Fernando A.

[iOSDeveloper] - ObjectiveC
[WebDesigner] - CSS3&HTML5
[WebDeveloper] - RubyOnRails
*--------------------------------------------------------------
*
[portfolio] http://www.fernandoaureliano.com -
[blog]http://www.fernandoaureliano.com/

On Thursday, June 16, 2011 8:14:19 PM UTC-4, Fernando A. wrote:

Ha!

I found a problem. The problem is because I try to register a user while
I’m logged on

But, how fix this?

Don’t register a user while you’re logged in.

Yeah, finally I got the answer!

http://stackoverflow.com/questions/6376718/devise-display-a-custom-sign-up-form-anywhere-in-your-app

But, for some reason, when I registered an user, he’s not recorded on
db.
But the terminal see the data correctly =/

In the terminal, I see the data, but the record its not happening. Oo

Started POST “/users” for 127.0.0.1 at 2011-06-16 20:13:33 -0300
Processing by Devise::RegistrationsController#create as HTML
Parameters: {“utf8”=>“✓”,
“authenticity_token”=>“ULeV0DeOgB+Ss2qD43to/TifRfGlHxcGhJ6XDDNviBo=”,
“user”=>{“nome”=>“fsdasdf”, “sobrenome”=>“fasdf”, “email”=>"
[email protected]", “tipo”=>“Distribuidores”,
“password”=>"[FILTERED]",
“password_confirmation”=>"[FILTERED]"}, “commit”=>“Sign up”}
User Load (1.0ms) SELECT “users”.* FROM “users” WHERE “users”.“id” =
1
LIMIT 1
Redirected to http://localhost:3000/admin
Completed 302 Found in 119ms

On Thu, Jun 16, 2011 at 6:42 PM, Fernando A. <
[email protected]> wrote:

correctly and it is going to the correct action. Then if all looks ok

<%= f.label :email %>

wrote:

For more options, visit this group at
Groups
“Ruby on Rails: Talk” group.
Fernando A.


Fernando A.

[iOSDeveloper] - ObjectiveC
[WebDesigner] - CSS3&HTML5
[WebDeveloper] - RubyOnRails
*--------------------------------------------------------------
*
[portfolio] http://www.fernandoaureliano.com -
[blog]http://www.fernandoaureliano.com/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs