At the point of this section *http://ruby.railstutorial.org/chapters/sign-up#sec-signup_failure*<http://ruby.railstutorial.org/chapters/sign-up#sec-signup_failure> clicking the "Create my account" button on the signup form shows the following image at <http://ruby.railstutorial.org/images/figures/signup_failure_rails_4.png> According to the tutorial, I must modify these files to rid myself of the error. - app/controllers/users_controller.rb - app/views/users/new.html.erb - app/views/shared/_error_messages.html.erb - app/assets/stylesheets/custom.css.scss I made all the modifications (until I saw the *working image*<http://ruby.railstutorial.org/images/figures/signup_error_messages_bootstrap.png>to the 4 files), and I still get the error image above when submitting the file, rather than a page that shows me that I left the fields blank. Can you help with this? -- 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/011433d1-505a-45c6-9829-2b65aac0d309%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
On 21 October 2013 18:35, desbest <afaninthehouse-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > At the point of this section > http://ruby.railstutorial.org/chapters/sign-up#sec-signup_failure > clicking the "Create my account" button on the signup form shows the following image at > > According to the tutorial, I must modify these files to rid myself of the error. > > app/controllers/users_controller.rb > app/views/users/new.html.erb > app/views/shared/_error_messages.html.erb > app/assets/stylesheets/custom.css.scss > > I made all the modifications (until I saw the working image to the 4 files), and I still get the error image above when submitting the file, rather than a page that shows me that I left the fields blank. > > Can you help with this?Please don''t use images, copy/paste the error and short segments of code here. First make sure you have checked the values of any variables (params for example) by checking the values passed in log/development.log and using puts to print values into the server window. Are you using exactly the versions of ruby, rails and gems expected by the tutorial? 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/CAL%3D0gLtYN6_aXXTQhypMV1d4SPv1ZHiC8tQJjBvempOmygLozA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
There is no params as I am just clicking a Signup button that''s on a page, then the error shows up. I''m using Ruby 1.9.3 and the latest versions of sass-rails and coffee-rails. On Monday, October 21, 2013 6:35:15 PM UTC+1, desbest wrote:> At the point of this section > *http://ruby.railstutorial.org/chapters/sign-up#sec-signup_failure*<http://ruby.railstutorial.org/chapters/sign-up#sec-signup_failure> > clicking the "Create my account" button on the signup form shows the > following image at > > <http://ruby.railstutorial.org/images/figures/signup_failure_rails_4.png> > According to the tutorial, I must modify these files to rid myself of the > error. > > - app/controllers/users_controller.rb > - app/views/users/new.html.erb > - app/views/shared/_error_messages.html.erb > - app/assets/stylesheets/custom.css.scss > > I made all the modifications (until I saw the *working image*<http://ruby.railstutorial.org/images/figures/signup_error_messages_bootstrap.png>to the 4 files), and I still get the error image above when submitting the > file, rather than a page that shows me that I left the fields blank. > > Can you help with this? > >-- 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/0a18599a-d16e-4f2e-8102-338da5de7aba%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
There is no params as I am just clicking a Signup button that''s on a page, then the error shows up. I''m using Ruby 1.9.3 and the latest versions of sass-rails and coffee-rails. development.log says this Started POST "/users" for 127.0.0.1 at 2013-10-21 19:35:27 +0100 Processing by UsersController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"OhWhPfhLH/3EDeb19LG9u96gu+FUY3cPa+ZdsPN01q8=", "user"=>{"name"=>"", "email"=>"", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Create my account"} Completed 500 Internal Server Error in 1ms ActiveModel::ForbiddenAttributesError (ActiveModel::ForbiddenAttributesError): app/controllers/users_controller.rb:12:in `create'' On Monday, October 21, 2013 6:35:15 PM UTC+1, desbest wrote:> At the point of this section > *http://ruby.railstutorial.org/chapters/sign-up#sec-signup_failure*<http://ruby.railstutorial.org/chapters/sign-up#sec-signup_failure> > clicking the "Create my account" button on the signup form shows the > following image at > > <http://ruby.railstutorial.org/images/figures/signup_failure_rails_4.png> > According to the tutorial, I must modify these files to rid myself of the > error. > > - app/controllers/users_controller.rb > - app/views/users/new.html.erb > - app/views/shared/_error_messages.html.erb > - app/assets/stylesheets/custom.css.scss > > I made all the modifications (until I saw the *working image*<http://ruby.railstutorial.org/images/figures/signup_error_messages_bootstrap.png>to the 4 files), and I still get the error image above when submitting the > file, rather than a page that shows me that I left the fields blank. > > Can you help with this? > >-- 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/202c19f8-fdec-433a-b6bb-1481e6e19d1a%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Jordon Bedwell
2013-Oct-21 18:40 UTC
Re: Re: I think I''ve found a mistake in Rails tutorial
On Mon, Oct 21, 2013 at 1:37 PM, desbest <afaninthehouse-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> There is no params as I am just clicking a Signup button that''s on a page, > then the error shows up. > I''m using Ruby 1.9.3 and the latest versions of sass-rails and > coffee-rails. > > development.log says this > > > Started POST "/users" for 127.0.0.1 at 2013-10-21 19:35:27 +0100 > Processing by UsersController#create as HTML > Parameters: {"utf8"=>"✓", > "authenticity_token"=>"OhWhPfhLH/3EDeb19LG9u96gu+FUY3cPa+ZdsPN01q8=", > "user"=>{"name"=>"", "email"=>"", "password"=>"[FILTERED]", > "password_confirmation"=>"[FILTERED]"}, "commit"=>"Create my account"} > Completed 500 Internal Server Error in 1ms > > ActiveModel::ForbiddenAttributesError > (ActiveModel::ForbiddenAttributesError): > app/controllers/users_controller.rb:12:in `create'' > >One should not claim a tutorial is broken before finishing it, because clearly further down: http://ruby.railstutorial.org/chapters/sign-up#sec-strong_parameters -- 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/CAM5XQnyyVxeVU3HJjF0w%3DhAJXjbkhSe4n4z2DvM4FPW7id5%2BBg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Jordon Bedwell
2013-Oct-21 18:45 UTC
Re: Re: I think I''ve found a mistake in Rails tutorial
On Mon, Oct 21, 2013 at 1:40 PM, Jordon Bedwell <envygeeks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> One should not claim a tutorial is broken before finishing it, because > clearly further down: > http://ruby.railstutorial.org/chapters/sign-up#sec-strong_parametersTo add since I neglected to mention it like I should have, just because your form is blank does not mean there are no params, blank or not it will create a param as the form still sends the fields, that is why you see them listed there with "". "" is not a null value, it is an empty value, empty != null, nil == null because even a blank value is a value to all systems. This is why Rails has .blank? and .present? so you can work around this situation, but tbh you should not need to as after you permit them and then pass them into the model it should have already done a validator stating that you do not wish it to be blank or null. -- 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/CAM5XQnzSSDPvswh76k%2BKu9fHQkpiKfHTDjjs3orRY1gxT3gDyA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Thanks for your help. It turns out I missed something out. (Figure 7:22) On 21 October 2013 19:45, Jordon Bedwell <envygeeks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Mon, Oct 21, 2013 at 1:40 PM, Jordon Bedwell <envygeeks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > One should not claim a tutorial is broken before finishing it, because > > clearly further down: > > http://ruby.railstutorial.org/chapters/sign-up#sec-strong_parameters > > To add since I neglected to mention it like I should have, just > because your form is blank does not mean there are no params, blank or > not it will create a param as the form still sends the fields, that is > why you see them listed there with "". "" is not a null value, it is > an empty value, empty != null, nil == null because even a blank value > is a value to all systems. This is why Rails has .blank? and > .present? so you can work around this situation, but tbh you should > not need to as after you permit them and then pass them into the model > it should have already done a validator stating that you do not wish > it to be blank or null. > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Ruby on Rails: Talk" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/rubyonrails-talk/ZF_MQ-kbFmI/unsubscribe > . > To unsubscribe from this group and all its topics, 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/CAM5XQnzSSDPvswh76k%2BKu9fHQkpiKfHTDjjs3orRY1gxT3gDyA%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/CAEZ7cNMGAhereDXBDtSJCOaiAdrW%2BtP0Rw1KyT57j%3D5bOYsOZQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Apparently Analagous Threads
- undefined method `paginate' for #<Class:0x567eb98> in Rails Tutorial
- Problem with undefined variable current_user
- rspec failure upon revisit
- attr_accessible on some properties + attr_protected on others makes class 'open-by-default'
- Optimistic Locking Enhancements: Gem or Core?