My forms looks like this and it is for UserPreference Model
user_preference.rb
<%= form_for @user_preference do |u|%>
<%= u.label :title %>
<%= u.text_field :title %>
<%= u.label :description %>
<%= u.text_field :description %>
<%= u.label :back_ground_color %>
Orange
Green
Blue
Pink
Yellow
White
<%= u.label :font %>
Times new Roman
Verdana
Arial
serif
<%= u.submit %>
user_preferences_controller.rb looks like this:
class UserPreferencesController < ApplicationController
def new
@user_preference = UserPreference.new
end
def create
@user_preference = UserPreference.new(userp_params)
@user_preference.save unless user_signed_in?
render plain: params[:user_preference].inspect
end
def edit
end
def update
end
private
def userp_params
params.require(:user_preference).permit(:title, :bgcolor, :font,
:description)
end
end
When I am trying to render params for user_preference I am getting only
title and description