Permalink
Browse files

Create user bug fixed.

  • Loading branch information...
1 parent de94b5d commit fd1f00d236c5d14dbd110f6daa4fb4e5477aadee @raskhadafi raskhadafi committed Feb 17, 2011
Showing with 9 additions and 1 deletion.
  1. +7 −0 app/controllers/users_controller.rb
  2. +1 −1 app/models/ability.rb
  3. +1 −0 config/locales/learnyt.de.yml
@@ -4,6 +4,13 @@
class UsersController < AuthorizedController
# Scopes
has_scope :tagged_with
+
+ def create
+ @user = User.new(params[:user])
+ @user.person = Person.create(:type => params[:user]['role_texts'].first.to_s.camelcase) if params[:user]['role_texts'].first
+
+ create!{ users_path }
+ end
# Actions
def update
View
@@ -8,7 +8,7 @@ class Ability
# Available roles
def self.roles
- ['admin', 'student', 'teacher']
+ ['admin', 'pupil', 'teacher']
end
# Prepare roles to show in select inputs etc.
@@ -176,6 +176,7 @@ de:
admin: 'Administrator'
student: 'Schüler'
teacher: 'Lehrer'
+ pupil: 'Schüler'
main_navigation:
settings: Einstellungen

0 comments on commit fd1f00d

Please sign in to comment.