authcan_easyroller 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -60,6 +60,9 @@ planned enhancements so you can get a feel of where this project will go.
60
60
 
61
61
  == Installation/Setup
62
62
 
63
+ <b>Developers Note:</b><em>I have created an example&nbsp;project[http://github.com/topherfangio/authcan_easyroller-example]
64
+ if you are just looking to play with it, or if you are having trouble getting your setup to work properly.</em>
65
+
63
66
  Assuming you already have Rails 3 installed, installation is very simple; just install the gem and
64
67
  it's dependencies!
65
68
 
@@ -67,8 +70,7 @@ it's dependencies!
67
70
 
68
71
  Next, add the dependencies to your <tt>Gemfile</tt>:
69
72
 
70
-
71
- gem "authlogic"
73
+ gem "authlogic", :git => "git://github.com/binarylogic/authlogic.git"
72
74
  gem "cancan"
73
75
  gem "easy_roles"
74
76
  gem "authcan_easyroller"
@@ -116,14 +118,16 @@ Once saved, migrate your database by running
116
118
 
117
119
  Next, copy the following files to their proper locations (feel free to edit them, these are just some basics to
118
120
  help get you started). The <tt>rails.js</tt> file at the bottom of the list is the official Rails jQuery file available
119
- at http://github.com/rails/jquery-ujs .
121
+ at http://github.com/rails/jquery-ujs so make sure to remove the existing <tt>rails.js</tt> file from <tt>public/javascripts</tt>.
120
122
 
121
123
  * ability.rb[http://github.com/topherfangio/authcan_easyroller/raw/master/examples/ability.rb] -> <<APPLICATION>>/app/models/ability.rb
122
124
  * application.html.erb[http://github.com/topherfangio/authcan_easyroller/raw/master/examples/application.html.erb] -> <<APPLICATION>>/app/view/layouts/application.html.erb
123
125
  * main.css[http://github.com/topherfangio/authcan_easyroller/raw/master/examples/main.css] -> <<APPLICATION>/public/stylesheets/main.css
124
126
  * rails.js[http://github.com/rails/jquery-ujs/raw/master/src/rails.js] -> <<APPLICATION>/public/javascripts/rails.js
125
127
 
128
+ Finally, remove <tt>public/index.html</tt> and add the following to your <tt>config/routs.rb</tt> file so that your server will load properly.
126
129
 
130
+ root :to => 'users#index'
127
131
 
128
132
  == Starting Your Engine
129
133
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -36,7 +36,7 @@ class AuthcanEasyrollerController < ApplicationController
36
36
  end
37
37
 
38
38
  def require_one_user
39
- if User.count == 0 and not users_url.match(/#{request.request_uri}$/) and not new_user_url.match(/#{request.request_uri}$/)
39
+ if User.count == 0 and not users_url.match(/#{request.fullpath}$/) and not new_user_url.match(/#{request.fullpath}$/)
40
40
  flash[:error] = "No users yet, must create one to access the site."
41
41
 
42
42
  redirect_to new_user_url
@@ -67,8 +67,8 @@ class AuthcanEasyrollerController < ApplicationController
67
67
  end
68
68
 
69
69
  def store_location
70
- unless new_user_url.match(/#{request.request_uri}$/) or new_user_session_url.match(/#{request.request_uri}$/)
71
- session[:return_to] = request.request_uri
70
+ unless new_user_url.match(/#{request.fullpath}$/) or new_user_session_url.match(/#{request.fullpath}$/)
71
+ session[:return_to] = request.fullpath
72
72
  end
73
73
  end
74
74
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{authcan_easyroller}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Topher Fangio"]
12
- s.date = %q{2010-03-31}
12
+ s.date = %q{2010-04-05}
13
13
  s.description = %q{This is a basic Rails engine utilizing Authlogic, CanCan and Easy Roles to create a starting point for simple Rails-based applications that need authentication and authorization. }
14
14
  s.email = %q{fangiotophia@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -1,34 +1,36 @@
1
1
  <html>
2
2
  <head>
3
+ <%= csrf_meta_tag %>
3
4
  <script src="http://www.google.com/jsapi"></script>
4
5
  <script>google.load("jquery", "1.4");</script>
5
-
6
+
6
7
  <%= stylesheet_link_tag 'main' %>
8
+ <%= yield :stylesheets %>
7
9
  </head>
8
-
9
- <body>
10
+
11
+ <body>
10
12
  <div id='navigation'>
11
13
  <%= link_to "Users", users_path %>
12
14
  </div>
13
-
15
+
14
16
  <div id='userland'>
15
17
  <% if current_user %>
16
18
  Welcome <%= current_user.email %>!
17
-
19
+
18
20
  <%= link_to "My Account", user_path(current_user) %>
19
21
  <%= link_separator %>
20
- <%= link_to "Logout", '/user_sessions/destroy' %>
22
+ <%= link_to "Logout", user_session_path, :method => :delete %>
21
23
  <% else %>
22
- You are not currently
24
+ You are not currently
23
25
  <%= link_to "logged in", new_user_session_path %>.
24
26
  <% end %>
25
27
  </div>
26
-
28
+
27
29
  <div id='flashes'>
28
30
  <%= raw "<h5 class='flash error'>#{flash[:error]}</h5>" unless flash[:error].blank? %>
29
31
  <%= raw "<h5 class='flash notice'>#{flash[:notice]}</h5>" unless flash[:notice].blank? %>
30
32
  </div>
31
-
33
+
32
34
  <div id='content'>
33
35
  <%= yield %>
34
36
  </div>
@@ -36,5 +38,11 @@
36
38
  <div id='copyright'>
37
39
  Copyright &copy; 2010, MyCompany. All rights reserved.
38
40
  </div>
41
+
42
+ <script src="http://www.google.com/jsapi"></script>
43
+ <script>google.load("jquery", "1.4");</script>
44
+ <%= javascript_include_tag 'rails' %>
45
+
46
+ <%= yield :javascript %>
39
47
  </body>
40
48
  </html>
@@ -4,17 +4,9 @@ require 'rails'
4
4
  # AuthcanEasyroller
5
5
  module AuthcanEasyroller
6
6
  class Engine < Rails::Engine
7
- engine_name :authcan_easyroller
8
-
9
7
  initializer "authcan_easyroller.configure_rails_initilization" do |app|
10
- # NOTE: The following has been commented out to bypass bug #3928 which will be fixed with the next release.
11
- #
12
- # Please comment these back in when Rails 3.0.0.beta2 or later version is used.
13
- #
14
- # Bug here: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/3928
15
- #
16
- # app.config.filter_parameters << :password
17
- # app.config.filter_parameters << :password_confirmation
8
+ app.config.filter_parameters << :password
9
+ app.config.filter_parameters << :password_confirmation
18
10
  end
19
11
  end
20
12
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Topher Fangio
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-31 00:00:00 -05:00
17
+ date: 2010-04-05 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency