Ruby on Rails Monday, December 28, 2015

On 28 December 2015 at 14:32, fugee ohu <fugee279@gmail.com> wrote:
> my _form.html.erb was rendered by new.html.erb; from my form:
> <%= form_for(@profile) do |f| %>
> from firefox->tools->web developer->page source
>
> <form class="new_profile" id="new_profile_0" action="/profiles"
> accept-charset="UTF-8" method="post"><input name="utf8" type="hidden"
> value="&#x2713;" /><input type="hidden" name="authenticity_token"
> value="COqGl7mSxKUqj0cTSqLfPJ4Ov40+Zv8iXhhdteiPDrNL6aD9OI+o0LxKAZ+rCy/zrDO0ROB1+yA3bEaZ8IHfQw=="
> />
>
> and then when submitted raises ActiveRecord::RecordNotUnique in
> ProfilesController#create
> the create action:
> def create
> @profile = Profile.new(profile_params)
> ...
> so what's wrong

As I am sure you saw when you googled for the error that this means
that one of your uniqueness constraints on the profile is being saved.

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@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvBvrxSY884VUCG-qFcOjvL_8pVdp41kFLVuDbov4HE0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment