diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index de412bc..003d797 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -10,6 +10,8 @@ class AdminController < ApplicationController def get_user @user = User.find_by_id(params[:admin_id].to_s) + arr = ["true", "false"] + @admin_select = @user.admin ? arr : arr.reverse render :partial => "layouts/admin/get_user" end diff --git a/app/views/layouts/admin/_get_user.html.erb b/app/views/layouts/admin/_get_user.html.erb index fbe5492..b2137e0 100644 --- a/app/views/layouts/admin/_get_user.html.erb +++ b/app/views/layouts/admin/_get_user.html.erb @@ -27,6 +27,9 @@ <%= f.label :password_confirmation, nil, {:class => "control-label"}%> <%= f.password_field :password_confirmation, {:class => "span12", :placeholder => "Enter Password"} %> + + <%= f.label :admin, nil, {:class => "control-label"}%> + <%= f.select(:admin, @admin_select) %>