I'm learning to render forms from different controllers, but when I try to save data, it says that I get
NoMethodError in ProfilesController#create
undefined method `stringify_keys' for "2":String
My routes file:
resources :users do
member do
get 'profile'
end
end
Profile model
belongs_to :user
User model
has_one :profile
views/profiles/_form.html.erb
<%= form_for [@user, @profile] do |f| %>
..
<% end %>
views/users/_form.html.erb
<%= render :partial => "profiles/form" %>
Also, to mention, when I tried to save the data, I get redirected to http://localhost:3000/users/2/profiles
where the error occurs, instead of http://localhost:3000/users/2/profile
notice the s
in profile, it changes on me?
Thanks!