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.
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :version_major: 0
3
3
  :version_minor: 2
4
- :version_patch: 14
4
+ :version_patch: 15
@@ -17,5 +17,5 @@
17
17
 
18
18
  def destroy
19
19
  session[:user_id] = nil
20
- redirect_to "root_url"
20
+ redirect_to root_url
21
21
  end
@@ -13,26 +13,30 @@
13
13
  def create
14
14
  @user = User.new(params[:user])
15
15
  if @user.save
16
- session[:user_id] = @user.id
17
- flash[:notice] = "Thank you for signing up! You are now logged in."
18
- redirect_to "/"
16
+ flash[:notice] = "User #{@user.email} created."
17
+ redirect_to users_url
19
18
  else
20
- render :action => 'new'
19
+ render 'new'
21
20
  end
22
21
  end
23
22
 
24
23
  def edit
25
- @user = current_user
24
+ @user = User.find(params[:id])
26
25
  end
27
26
 
28
27
  def update
29
- @user = current_user
28
+ @user = User.find(params[:id])
30
29
  respond_to do |format|
31
30
  if @user.update_attributes(params[:user])
32
- format.html { redirect_to(root_path, :notice => 'User information updated.') }
31
+ redirect_to root_path, :notice => 'User information updated.'
33
32
  else
34
- format.html { render :action => "edit" }
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
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: i0n_rails3_generators
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.14
5
+ version: 0.2.15
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ian Alexander Wood (i0n)