How should I use rails and simple_form for nested resources?
I'm trying to create one resource with another nested resource at the same time. I'm using Rails4 and simple_form 3.0.0rc. Here is my code. Models: class User < ActiveRecord::Base has_one :profile accepts_nested_attributes_for :profile end class Profile < ActiveRecord::Base belongs_to :user end Controller: class UsersController < ApplicationController def new @user = User.new @user.build_profile end def create user = User.new user_params user.save redirect_to root_url # @par =params end private def user_params params.require(:user).permit(:email, profile_attributes: [:name]) end end View (form