Skip to content

Commit

Permalink
Create user bug fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
raskhadafi committed Feb 17, 2011
1 parent de94b5d commit fd1f00d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/controllers/users_controller.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/models/ability.rb
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions config/locales/learnyt.de.yml
Expand Up @@ -176,6 +176,7 @@ de:
admin: 'Administrator'
student: 'Schüler'
teacher: 'Lehrer'
pupil: 'Schüler'

main_navigation:
settings: Einstellungen
Expand Down

0 comments on commit fd1f00d

Please sign in to comment.