Hi is I''m making a web app in which I am asked to register users, I did this already with Devise the problem is that I also create a profile for each user to register ... anyone have idea how to do? if so thank you very much hope you can help me -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6a52e5b7-d6a0-4c02-854e-71aa6c364267%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
On 22 October 2013 21:27, Orlando Hernandez <ohernandez-p6896n8EGo1MqUckJh7upg@public.gmane.org> wrote:> Hi is I''m making a web app in which I am asked to register users, I did this > already with Devise the problem is that I also create a profile for each > user to register ... anyone have idea how to do? if so thank you very much > hope you can help meGoogling for rails devise user profile provides many hits that look as if they may answer this question. Colin> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/6a52e5b7-d6a0-4c02-854e-71aa6c364267%40googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsPESXnE7_dQ72stW4%3DjA%3DUHY2X3dLF4SEiOBHzX5hYiQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
On Tue, Oct 22, 2013 at 4:27 PM, Orlando Hernandez <ohernandez-p6896n8EGo1MqUckJh7upg@public.gmane.org> wrote:> I''m making a web app in which I am asked to register users, I did this > already with Devise the problem is that I also create a profile for each > user to register ... anyone have idea how to do?There are two main ways to do this. One very common way is to just tack more fields onto your User model. This isn''t very good, though, as your User model then fulfills different duties: holding the credentials for logging in (the main duty), holding whatever other profile-type info you want to store, etc. Having the objects of one class fulfill a bunch of different duties violates what Object Oriented people call the "Single Responsibility Principle" (SRP), and makes it a "God Object" (very powerful, yes, but usually so big, and with so much tight coupling between the different duties, that it''s very hard to maintain). Much "cleaner" is to create another model, called something like Profile, and have either Profile belong to User or vice-versa or both. (Which way you do it may depend on things like whether you want one User to be able to have multiple Profiles, or let multiple Users share a Profile, or maybe even both. Assuming you want "one User, one Profile", it probably won''t matter much.) -Dave -- Dave Aronson, the T. Rex of Codosaurus LLC, secret-cleared freelance software developer taking contracts in or near NoVa or remote. See information at http://www.Codosaur.us/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHxKQiicdqgP3uCgy%2B4aG10As8LZ-SE3b7KP7gzGqAaVRVrJFA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Hello thank you very much and seriously almost solved the problem and was not as complicated as I imagined thank you both for responding and it really is nice to have a community that is willing to help 2013/10/26 Dave Aronson <googlegroups2dave-BRiZGj7G2yRXqviUI+FSNg@public.gmane.org>> On Tue, Oct 22, 2013 at 4:27 PM, Orlando Hernandez > <ohernandez-p6896n8EGo1MqUckJh7upg@public.gmane.org> wrote: > > > I''m making a web app in which I am asked to register users, I did this > > already with Devise the problem is that I also create a profile for each > > user to register ... anyone have idea how to do? > > There are two main ways to do this. > > One very common way is to just tack more fields onto your User model. > This isn''t very good, though, as your User model then fulfills > different duties: holding the credentials for logging in (the main > duty), holding whatever other profile-type info you want to store, > etc. Having the objects of one class fulfill a bunch of different > duties violates what Object Oriented people call the "Single > Responsibility Principle" (SRP), and makes it a "God Object" (very > powerful, yes, but usually so big, and with so much tight coupling > between the different duties, that it''s very hard to maintain). > > Much "cleaner" is to create another model, called something like > Profile, and have either Profile belong to User or vice-versa or both. > (Which way you do it may depend on things like whether you want one > User to be able to have multiple Profiles, or let multiple Users share > a Profile, or maybe even both. Assuming you want "one User, one > Profile", it probably won''t matter much.) > > -Dave > > -- > Dave Aronson, the T. Rex of Codosaurus LLC, > secret-cleared freelance software developer > taking contracts in or near NoVa or remote. > See information at http://www.Codosaur.us/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/CAHxKQiicdqgP3uCgy%2B4aG10As8LZ-SE3b7KP7gzGqAaVRVrJFA%40mail.gmail.com > . > For more options, visit https://groups.google.com/groups/opt_out. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPV0r6X_psPXmDxrS2CunuFKAVmsMAOGvO7D-jrPfdT%3Du1ij3A%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
On Sat, Oct 26, 2013 at 2:31 PM, Orlando Hernandez <ohernandez-p6896n8EGo1MqUckJh7upg@public.gmane.org> wrote:> was not as complicated as I imaginedIt''s amazing how many problems are that way!> it really is nice to have a community that is willing to helpYup, that''s one of the things I love about Ruby. For whatever reason, the Ruby community has become much more open, welcoming, willing to bend over backwards to help, etc. than any other technical community I have ever seen. They were very patient with me at my first RubyDCamp, which I went to two weeks after learning my first little bit of Ruby.... -Dave -- Dave Aronson, the T. Rex of Codosaurus LLC, secret-cleared freelance software developer taking contracts in or near NoVa or remote. See information at http://www.Codosaur.us/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHxKQihdv2dh76H9F%2BhPnTQCa_XkXmnoEx9nD%3DutuONrOs3gTw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.