summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-30 15:49:13 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-30 15:49:13 +0100
commitf2bb713ff7b02485f551fe97071f4af08d957caf (patch)
treef1512373f5652467285a7f39622d12dedd4112a2
parentf85bb3c49ee0bac3be836628685fe080da78e823 (diff)
parentcaf624f11f7de44289b3c994fc72cc5e32ed799e (diff)
Merge branch 'fix_user_group_adding' into develop
-rw-r--r--app/controllers/user_groups_controller.rb2
-rw-r--r--app/views/user_groups/_form.html.haml2
-rw-r--r--app/views/user_groups/_form_core.html.haml2
3 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/user_groups_controller.rb b/app/controllers/user_groups_controller.rb
index 158abaa..64e7136 100644
--- a/app/controllers/user_groups_controller.rb
+++ b/app/controllers/user_groups_controller.rb
@@ -19,7 +19,7 @@ class UserGroupsController < ApplicationController
def create
@user_group = @parent.user_groups.build(params[:user_group])
if @user_group.save
- redirect_to @user_group, :notice => t('user_groups.controller.successfuly_created')
+ redirect_to [@parent, @user_group], :notice => t('user_groups.controller.successfuly_created')
else
render :new
end
diff --git a/app/views/user_groups/_form.html.haml b/app/views/user_groups/_form.html.haml
index cbe3cc4..3263fdd 100644
--- a/app/views/user_groups/_form.html.haml
+++ b/app/views/user_groups/_form.html.haml
@@ -1,4 +1,4 @@
-= simple_form_for(@user_group) do |f|
+= simple_form_for([@parent, @user_group]) do |f|
= f.error_notification
= render "form_core", :f => f
diff --git a/app/views/user_groups/_form_core.html.haml b/app/views/user_groups/_form_core.html.haml
index a45ba6f..edb0dbc 100644
--- a/app/views/user_groups/_form_core.html.haml
+++ b/app/views/user_groups/_form_core.html.haml
@@ -1,3 +1,3 @@
.inputs
- = f.input :name, :label => t('user_groups.form.name.label'), :hint => conditional_hint('user_groups.form.name.hint')
+ = f.input :name, :label => t('user_groups.form.name.label'), :hint => conditional_hint('user_groups.form.name.hint'), :autofocus => true
= f.input :description, :label => t('user_groups.form.description.label'), :hint => conditional_hint('user_groups.form.description.hint')