i0n_rails3_generators 0.2.14 → 0.2.15
Sign up to get free protection for your applications and to get access to all the features.
- data/config/version.yml +1 -1
- data/lib/generators/i0n/authentication/templates/app/controllers/_user_sessions_controller.rb +1 -1
- data/lib/generators/i0n/authentication/templates/app/controllers/_users_controller.rb +13 -9
- data/lib/generators/i0n/authentication/templates/app/views/users/index.haml +3 -1
- data/lib/generators/i0n/layout/layout_generator.rb +6 -0
- metadata +1 -1
data/config/version.yml
CHANGED
@@ -13,26 +13,30 @@
|
|
13
13
|
def create
|
14
14
|
@user = User.new(params[:user])
|
15
15
|
if @user.save
|
16
|
-
|
17
|
-
|
18
|
-
redirect_to "/"
|
16
|
+
flash[:notice] = "User #{@user.email} created."
|
17
|
+
redirect_to users_url
|
19
18
|
else
|
20
|
-
render
|
19
|
+
render 'new'
|
21
20
|
end
|
22
21
|
end
|
23
22
|
|
24
23
|
def edit
|
25
|
-
@user =
|
24
|
+
@user = User.find(params[:id])
|
26
25
|
end
|
27
26
|
|
28
27
|
def update
|
29
|
-
@user =
|
28
|
+
@user = User.find(params[:id])
|
30
29
|
respond_to do |format|
|
31
30
|
if @user.update_attributes(params[:user])
|
32
|
-
|
31
|
+
redirect_to root_path, :notice => 'User information updated.'
|
33
32
|
else
|
34
|
-
|
33
|
+
render "edit"
|
35
34
|
end
|
36
35
|
end
|
37
36
|
end
|
38
|
-
|
37
|
+
|
38
|
+
def destroy
|
39
|
+
@user = User.find(params[:id])
|
40
|
+
@user.destroy
|
41
|
+
redirect_to users_url
|
42
|
+
end
|
@@ -4,9 +4,11 @@
|
|
4
4
|
- content_for :description do
|
5
5
|
description goes here
|
6
6
|
|
7
|
+
= link_to "New User", new_user_path
|
8
|
+
|
7
9
|
- @users.each do |user|
|
8
10
|
%p
|
9
11
|
%span
|
10
12
|
= user.email
|
11
13
|
= link_to "Edit User", edit_user_path(user)
|
12
|
-
|
14
|
+
= link_to "Delete User", user_path(user), :method => "delete"
|
@@ -13,6 +13,8 @@ module I0n
|
|
13
13
|
# Stylesheets
|
14
14
|
gem "compass"
|
15
15
|
gem 'compass-susy-plugin'
|
16
|
+
# JavaScript
|
17
|
+
gem 'jquery-rails'
|
16
18
|
end
|
17
19
|
|
18
20
|
def setup_application
|
@@ -44,6 +46,10 @@ end
|
|
44
46
|
copy_file "app/views/shared/_error_messages.haml", "#{Rails.root}/app/views/shared/_error_messages.haml"
|
45
47
|
end
|
46
48
|
|
49
|
+
def generate_jquery
|
50
|
+
generate("jquery:install")
|
51
|
+
end
|
52
|
+
|
47
53
|
end
|
48
54
|
end
|
49
55
|
end
|