-
-
Save krlicmuhamed/f8a5c9124ac1d06c71c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for @user_category do |f| %> | |
<p> | |
<%= f.label :description %> | |
<%= f.text_field :description %> | |
</p> | |
<p> | |
<%= f.radio_button :status, true, :id => 'status_true' %> | |
<%= f.label 'Ativo', :for => 'status_true' %> | |
<%= f.radio_button :status, false, :id => 'status_false' %> | |
<%= f.label 'Inativo', :for => 'status_false' %> | |
</p> | |
<p> | |
<%= f.submit 'OK' %> | |
</p> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Admin::UserCategoriesController < ApplicationController | |
params.require(:admin_user_category).permit(:description, :status) | |
def index | |
end | |
def new | |
@user_category = Admin::UserCategory.new | |
end | |
def create | |
render plain: params[:user_category].inspect | |
return | |
@user_category = Admin::UserCategory.new(params[:description],params[:status]) | |
if @user_category.save | |
redirect_to @user_category | |
else | |
render 'new' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment