casein 3.1.11 → 4.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +1 -0
  3. data/MIT-LICENSE +2 -1
  4. data/PUBLIC_VERSION.yml +4 -4
  5. data/README.rdoc +68 -71
  6. data/Rakefile +9 -8
  7. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/casein.png +0 -0
  8. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/header.png +0 -0
  9. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/icons/add.png +0 -0
  10. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/icons/delete.png +0 -0
  11. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/icons/table.png +0 -0
  12. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/login/alertBg.png +0 -0
  13. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/login/background.png +0 -0
  14. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/login/bottom.png +0 -0
  15. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/login/loginBoxBg.png +0 -0
  16. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/login/loginBoxBottom.png +0 -0
  17. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/login/loginBoxTop.png +0 -0
  18. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/login/loginSubmit.png +0 -0
  19. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/login/recoverSubmit.png +0 -0
  20. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/login/top.png +0 -0
  21. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/nav.png +0 -0
  22. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/rightNav.png +0 -0
  23. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/rightNavButton.png +0 -0
  24. data/{lib/generators/casein/update/templates/public/casein/images → app/assets/images/casein}/visitSiteNav.png +0 -0
  25. data/{lib/generators/casein/update/templates/public/casein/javascripts → app/assets/javascripts/casein}/casein.js +3 -0
  26. data/{lib/generators/casein/update/templates/public/casein/javascripts → app/assets/javascripts/casein}/login.js +3 -0
  27. data/app/assets/stylesheets/casein/casein.css.scss +4 -0
  28. data/{lib/generators/casein/update/templates/public/casein/stylesheets/elements.css → app/assets/stylesheets/casein/elements.css.scss} +1 -1
  29. data/{lib/generators/casein/update/templates/public/casein/stylesheets/login.css → app/assets/stylesheets/casein/login.css.scss} +2 -2
  30. data/{lib/generators/casein/update/templates/public/casein/stylesheets/screen.css → app/assets/stylesheets/casein/screen.css.scss} +10 -10
  31. data/app/controllers/casein/users_controller.rb +10 -4
  32. data/app/helpers/casein/casein_helper.rb +2 -2
  33. data/app/views/casein/users/index.html.erb +1 -1
  34. data/app/views/layouts/casein_auth.html.erb +3 -3
  35. data/config/routes.rb +3 -3
  36. data/lib/casein.rb +1 -1
  37. data/lib/casein/engine.rb +4 -0
  38. data/lib/generators/casein/install/USAGE +1 -1
  39. data/lib/generators/casein/install/install_generator.rb +2 -2
  40. data/lib/generators/casein/install/templates/{public/casein/javascripts → app/assets/javascripts/casein}/custom.js +0 -0
  41. data/lib/generators/casein/install/templates/{public/casein/stylesheets/custom.css → app/assets/stylesheets/casein/custom.css.scss} +1 -1
  42. data/lib/generators/casein/install/templates/app/helpers/casein/config_helper.rb +28 -28
  43. data/lib/generators/casein/scaffold/templates/controller.rb +14 -2
  44. data/lib/generators/casein/scaffold/templates/views/_table.html.erb +1 -1
  45. metadata +86 -116
  46. data/lib/generators/casein/update/USAGE +0 -1
  47. data/lib/generators/casein/update/templates/public/casein/javascripts/jquery.js +0 -154
  48. data/lib/generators/casein/update/templates/public/casein/javascripts/rails.js +0 -132
  49. data/lib/generators/casein/update/update_generator.rb +0 -40
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 578b6e6643025f347d184e451109b3b72c5695b7
4
+ data.tar.gz: 53a3862aa9d7588e5178d00746a0f2c8e5667b4b
5
+ SHA512:
6
+ metadata.gz: acc98be3977d289cb0efd059ff78e7d96573453e204167afe6172bc945103fa77f5679b764843100d84bed638d89fc489d9db3c4718a2bd3b71e7846eea95bf5
7
+ data.tar.gz: 50f3d65970c19250990fec2ac59dfb5bbb760c14f773efbfaa95234a8ece2618a7592d0aa6e02c471a6cf8bacd904f5d6d74cdee9689733f142c663361d2a2fb
data/Gemfile CHANGED
@@ -1 +1,2 @@
1
+ source 'https://rubygems.org'
1
2
  gemspec
@@ -1,4 +1,5 @@
1
- Copyright (c) 2010-2011 Spoiled Milk ApS
1
+ Copyright (c) 2013 Russell Quinn
2
+ Copyright (c) 2010-2012 Spoiled Milk ApS and Russell Quinn
2
3
 
3
4
  Permission is hereby granted, free of charge, to any person obtaining
4
5
  a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- major: 3
2
- minor: 1
3
- patch: 11
4
- build:
1
+ major: 4
2
+ minor: 0
3
+ patch: 0
4
+ build: beta1
@@ -1,26 +1,37 @@
1
- =Casein - a lightweight Ruby on Rails CMS.
1
+ =Casein - a lightweight Ruby on Rails CMS
2
2
 
3
- Casein is a plugin that provides scaffolding generators and helper functions to quickly create a clean and minimal CRUD (Create, Read, Update and Delete) interface for your data. It also comes with a pre-rolled user authentication system. As Casein is completely decoupled from the front-end, it can be added to a new or existing Rails project, or used as a standalone CMS to drive platforms built on other technologies.
3
+ **WORK IN PROGRESS FOR A RAILS 4.x VERSION**
4
4
 
5
- This version of Casein is designed for Ruby on Rails 3.x. For a legacy version that is compatible with Rails 2.x, see: http://github.com/spoiledmilk/casein
5
+ Casein is a Rails 4.x gem that provides scaffolding generators and helper functions to quickly create a clean and minimal CRUD (Create, Read, Update and Delete) interface for your data. It also comes with a pre-rolled user authentication system. As Casein is completely decoupled from the front-end, it can be added to a new or existing Rails project, or used as a standalone CMS to drive platforms built on other technologies.
6
+
7
+ ==Requirements
8
+
9
+ This version of Casein is designed for Ruby on Rails 4.x and Ruby 2.x.
10
+
11
+ Legacy versions:
12
+
13
+ Rail 3.x: http://github.com/spoiledmilk/casein3
14
+
15
+ Rails 2.x: http://github.com/spoiledmilk/casein
6
16
 
7
17
  ==Disclaimer
8
18
 
9
- Casein is the in-house CMS framework used by digital agency Spoiled Milk and is being used in many live production websites. This open source project is an attempt to extract and share the core.
19
+ Casein was created and is maintained by Russell Quinn (http://www.russellquinn.com)
20
+
21
+ Previous versions of Casein were sponsored by Spoiled Milk (http://www.spoiledmilk.com)
10
22
 
11
23
  Casein is available to use under the terms of the MIT License. See the LICENSE file for more details.
12
24
 
13
- Casein is sponsored by Spoiled Milk (http://www.spoiledmilk.dk) and maintained by Russell Quinn (http://www.russellquinn.com)
25
+ ==What’s New
26
+
27
+ Casein 4.x built for Ruby on Rails 3 and has the following major updates:
14
28
 
15
- Casein 3.x is built for Ruby on Rails 3 and has the following major updates:
29
+ * Support for strong parameters
30
+ * Support for asset pipeline
31
+ * Rails 4 compatibility fixes
32
+ * Many other tweaks and improvements over Casein 3.x
16
33
 
17
- * Authentication changed to use Authlogic
18
- * Supplied as a gem
19
- * Runs as an Engine
20
- * Now properly namespaced
21
- * Timezone support
22
- * Rails 3 compatibility fixes
23
- * Many other tweaks and improvements over Casein 2.x
34
+ There is no real upgrade path from previous versions of Casein. It’s recommended to only use Casein 4.x on new projects.
24
35
 
25
36
  ==Installation
26
37
 
@@ -29,37 +40,19 @@ Casein 3.x is built for Ruby on Rails 3 and has the following major updates:
29
40
  — Add the Casein gem to your Gemfile:
30
41
 
31
42
  gem 'casein'
32
-
33
- - Then use bundler to install Casein and its dependencies:
34
43
 
35
- sudo bundle install
44
+ Then use bundler to install Casein and its dependencies:
45
+
46
+ bundle install
36
47
 
37
48
  — If you have just created a new project, then remember to add your database details to /config/database.yml at this point.
38
49
 
39
- These installation instructions also assume that you have set up your RAILS_ENV environment variable.
40
-
41
- — To enable Casein notification emails (used for new users and forgotten passwords) then add your SMTP server information to your initializers. For example create a new file called initializers/setup_mail.rb and add the following to it:
42
-
43
- ActionMailer::Base.delivery_method = :smtp
44
- ActionMailer::Base.raise_delivery_errors = false
45
- ActionMailer::Base.smtp_settings = {
46
- :enable_starttls_auto => false,
47
- :address => "mail.yourdomain.com",
48
- :port => 25,
49
- :domain => "yourdomain.com",
50
- :user_name => "donotreply@yourdomain.com",
51
- :password => "whatever",
52
- :authentication => :login
53
- }
50
+ To enable Casein notification emails (used for new users and forgotten passwords) then add your SMTP server information to your initializers. For development, you can use something cool like MailCatcher (http://mailcatcher.me)
54
51
 
55
52
  — Install Casein configuration files into your project. This should not be run more than once without backing up or merging the generated files, as your customisations will be overwritten:
56
53
 
57
54
  rails g casein:install
58
55
 
59
- — Add Casein assets to your project /public folder. These should not be modified as they may be overwritten in future updates:.
60
-
61
- rails g casein:update
62
-
63
56
  — Perform a database migration to create the Casein users table:
64
57
 
65
58
  rake db:create (if needed)
@@ -81,7 +74,39 @@ The default Casein install supports user authentication. Users may have a status
81
74
 
82
75
  Casein is a framework allowing you to quickly build up an interface to edit and create new records from your database model. As well as the user support and user interface, there are many configurations and generators to help you along the way.
83
76
 
84
- ==Configuration
77
+ ==Scaffolding
78
+
79
+ Casein has a scaffolding generator to automatically create all the CRUD views and controllers for your project models. This is the fastest way to add Casein support to your project.
80
+
81
+ The command to run the scaffolding generator is:
82
+
83
+ rails g casein:scaffold ModelName [field:type, field:type]
84
+
85
+ Where:
86
+
87
+ * ModelName – The singular name of your model, e.g. customer
88
+ * field:type – The name of your database fields and their types, e.g. name:string. The field name must match the name in your migrations and the type must be one of the Rails migration types (string, text, integer, float, decimal, datetime, timestamp, time, date, binary, boolean). Note that you do not have to specify all of the fields in your model, but just the ones that you wish to be editable in Casein.
89
+
90
+ e.g. a typical scaffolding command might look like:
91
+
92
+ rails g casein:scaffold customer name:string age:integer date_of_birth:date is_male:boolean
93
+
94
+ There is one command-line option that can be added to the end of the generate command:
95
+
96
+ --create-model-and-migration = Also creates a model and migration. By default the scaffold generator will work from existing models, but this option will generate the model and database migration files for you. This means you can also use Casein to set up a new project quickly as well.
97
+
98
+ Once the command has been executed, the generator will:
99
+
100
+ * Add a new tab for the model to: app/views/casein/layouts/_left_navigation.html.erb
101
+ * Create a controller with the name: app/controllers/casein/model_controller.erb
102
+ * Add views for index, new and show to: app/views/casein/model/
103
+ * If you restart and run your application now, you’ll be able to log in to Casein and directly edit and create new instances of your model data right away!
104
+
105
+ However, you’ll probably want to customise your views and side bars and extend your controller to suit your project. The scaffold generator just sets up the defaults for you.
106
+
107
+ <em>NOTE: Once you start customising the generated scaffolding files, you should be aware that if you run the generator again you should not overwrite the changed files without backing them up first. The generator will warn you each time it finds a file that you’ve customised. If you run the scaffold generator from a new version of Casein, then you should manually merge your backup and the new file. You can of course however, leave your originals untouched.</em>
108
+
109
+ ==General Configuration
85
110
 
86
111
  <b>app/helpers/casein/config_helper.rb</b>
87
112
 
@@ -95,13 +120,13 @@ An ERB partial for the the left navigation tabs. Note that using the scaffolding
95
120
 
96
121
  An ERB partial for the the right navigation tabs. Note that the ‘users’ tab is added automatically for admin users.
97
122
 
98
- <b>/public/casein/javascripts/custom.js & /public/casein/stylesheets/custom.css</b>
123
+ <b>/assets/javascripts/casein/custom.js & /assets/stylesheets/casein/custom.css.scss</b>
99
124
 
100
- The Casein assets are located in /public/casein. These are the only two files you should change. They allow you to add custom JavaScript or CSS to your Casein deployment. These files are not overwritten using the ‘rails g casein:update’ command.
125
+ These files are added to your app’s /assets directory. They allow you to add custom JavaScript or CSS to your Casein deployment.
101
126
 
102
127
  ==Customising
103
128
 
104
- Now that you have the basic Casein installed and configured, you’ll want to extend it so that it actually has some functionality for your project!
129
+ Once you have the Casein core installed and configured, and have added support for your models with the scaffolding generator, you’ll want to extend it so that it actually has some functionality for your project!
105
130
 
106
131
  <b>Rules and conventions</b>
107
132
 
@@ -143,38 +168,6 @@ There are several Casein Rake tasks available to manage users. To see what is av
143
168
 
144
169
  The Casein Rake tasks are all namespaced with ‘casein:’
145
170
 
146
- ==Scaffolding
147
-
148
- Casein has a scaffolding generator to automatically create all the views and controllers for your project models. This is the fastest way to add Casein support to your project.
149
-
150
- The command to run the scaffolding generator is:
151
-
152
- rails g casein:scaffold ModelName [field:type, field:type]
153
-
154
- Where:
155
-
156
- * ModelName – The singular name of your model, e.g. customer
157
- * field:type – The name of your database fields and their types, e.g. name:string. The field name must match the name in your migrations and the type must be one of the Rails migration types (string, text, integer, float, decimal, datetime, timestamp, time, date, binary, boolean). Note that you do not have to specify all of the fields in your model, but just the ones that you wish to be editable in Casein.
158
-
159
- e.g. a typical scaffolding command might look like:
160
-
161
- rails g casein:scaffold customer name:string age:integer date_of_birth:date is_male:boolean
162
-
163
- There is one command-line option that can be added to the end of the generate command:
164
-
165
- --create-model-and-migration = Also creates a model and migration. By default the scaffold generator will work from existing models, but this option will generate the model and database migration files for you. This means you can also use Casein to set up a new project quickly as well.
166
-
167
- Once the command has been executed, the generator will:
168
-
169
- * Add a new tab for the model to: app/views/casein/layouts/_left_navigation.html.erb
170
- * Create a controller with the name: app/controllers/casein/model_controller.erb
171
- * Add views for index, new and show to: app/views/casein/model/
172
- * If you restart and run your application now, you’ll be able to log in to Casein and directly edit and create new instances of your model data right away!
173
-
174
- However, you’ll probably want to customise your views and side bars and extend your controller to suit your project. The scaffold generator just sets up the defaults for you.
175
-
176
- <em>NOTE: Once you start customising the generated scaffolding files, you should be aware that if you run the generator again you should not overwrite the changed files without backing them up first. The generator will warn you each time it finds a file that you’ve customised. If you run the scaffold generator from a new version of Casein, then you should manually merge your backup and the new file. You can of course however, leave your originals untouched.</em>
177
-
178
171
  ===Changing form elements / other helpers
179
172
 
180
173
  Casein will insert form elements suitable for the field types you specified in the command line. However, you may wish to customise these, e.g. swap a text field for a password field, swap an integer field for a select dropdown, or swap a date field for a full calendar picker, etc.
@@ -223,6 +216,10 @@ e.g.
223
216
 
224
217
  match ':controller(/:action(/:id(.:format)))', :constraints => Casein::RouteConstraint.new
225
218
 
219
+ ===Default Timezone
220
+
221
+ Every Casein user can set their own timezone via their profile. To change the default timezone for new users, set config.time_zone in your app.
222
+
226
223
  ==Acknowledgements
227
224
 
228
225
  The icons used in Casein were created by Mark James and are licensed under the Creative Commons Attribution 2.5 License (http://creativecommons.org/licenses/by/2.5/). The full series of icons are available here: http://www.famfamfam.com/lab/icons/silk/
data/Rakefile CHANGED
@@ -1,11 +1,11 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require 'rake/rdoctask'
3
+ require 'rdoc/task'
4
4
 
5
5
  desc 'Default: run unit tests.'
6
6
  task :default => :test
7
7
 
8
- desc 'Test the casein gem.'
8
+ desc 'Test the Casein gem.'
9
9
  Rake::TestTask.new(:test) do |t|
10
10
  t.libs << 'lib'
11
11
  t.libs << 'test'
@@ -13,7 +13,7 @@ Rake::TestTask.new(:test) do |t|
13
13
  t.verbose = true
14
14
  end
15
15
 
16
- desc 'Generate documentation for the casein gem.'
16
+ desc 'Generate documentation for the Casein gem.'
17
17
  Rake::RDocTask.new(:rdoc) do |rdoc|
18
18
  rdoc.rdoc_dir = 'rdoc'
19
19
  rdoc.title = 'Casein'
@@ -27,13 +27,14 @@ begin
27
27
  Jeweler::Tasks.new do |gem|
28
28
  gem.name = "casein"
29
29
  gem.summary = "A lightweight Ruby on Rails CMS."
30
- gem.description = "Casein is an open-source CMS for Ruby on Rails, originally developed by Spoiled Milk."
30
+ gem.description = "Casein is an open-source CMS for Ruby on Rails."
31
31
  gem.files = Dir["Gemfile", "MIT-LICENSE", "Rakefile", "README.rdoc", "PUBLIC_VERSION.yml", "{lib}/**/*", "{app}/**/*", "{config}/**/*"]
32
32
  gem.email = "mail@russellquinn.com"
33
- gem.authors = ["Russell Quinn", "Spoiled Milk"]
34
- gem.homepage = "http://github.com/spoiledmilk/casein3"
35
- gem.add_dependency("will_paginate", ["3.0.0"])
36
- gem.add_dependency("authlogic", ["3.0.3"])
33
+ gem.authors = ["Russell Quinn"]
34
+ gem.homepage = "http://github.com/russellquinn/casein"
35
+ gem.add_dependency("will_paginate", ["3.0.4"])
36
+ gem.add_dependency("authlogic", ["3.3.0"])
37
+ gem.add_dependency("jquery-rails")
37
38
  end
38
39
  rescue
39
40
  puts "Jeweler or one of its dependencies is not installed."
@@ -1,3 +1,6 @@
1
+ //= require jquery
2
+ //= require jquery_ujs
3
+
1
4
  jQuery(document).ready(function()
2
5
  {
3
6
  var contentHeight = Math.round(jQuery(window).height() - 130);
@@ -1,3 +1,6 @@
1
+ //= require jquery
2
+ //= require jquery_ujs
3
+
1
4
  jQuery(document).ready(function()
2
5
  {
3
6
  if(jQuery("#notice"))
@@ -0,0 +1,4 @@
1
+ /*
2
+ *= require ./elements.css.scss
3
+ *= require ./screen.css.scss
4
+ */
@@ -64,7 +64,7 @@
64
64
 
65
65
  #content .openFolder {
66
66
  border-bottom: 1px solid #ddd;
67
- background: url(/casein/images/icons/folder.png) no-repeat center left;
67
+ background: image-url('folder.png') no-repeat center left;
68
68
  font-weight: bold;
69
69
  cursor: pointer;
70
70
  }
@@ -16,7 +16,7 @@ a {
16
16
  }
17
17
 
18
18
  #header {
19
- background: #efefef url(/casein/images/login/top.png) repeat-x bottom left;
19
+ background: #efefef image-url('casein/login/top.png') repeat-x bottom left;
20
20
  padding: 80px 0 40px 0;
21
21
  }
22
22
 
@@ -32,7 +32,7 @@ a {
32
32
  }
33
33
 
34
34
  #content {
35
- background: #fff url(/casein/images/login/bottom.png) repeat-x bottom left;
35
+ background: #fff image-url('casein/login/bottom.png') repeat-x bottom left;
36
36
  padding: 70px 0;
37
37
  }
38
38
 
@@ -69,7 +69,7 @@ div.loginBox {
69
69
  height: 96px;
70
70
  padding: 25px;
71
71
  position: relative;
72
- background: url(/casein/images/header.png) repeat-x top left;
72
+ background: image-url('casein/header.png') repeat-x top left;
73
73
  z-index: 900;
74
74
  }
75
75
 
@@ -133,18 +133,18 @@ div.loginBox {
133
133
  #navigation li a {
134
134
  color: #fff;
135
135
  padding: 11px 12px 9px 12px;
136
- background: url(/casein/images/nav.png) repeat-x bottom left;
136
+ background: image-url('casein/nav.png') repeat-x bottom left;
137
137
  text-decoration: none;
138
138
  }
139
139
 
140
140
  #navigation li a:hover {
141
141
  padding: 11px 12px 9px 12px;
142
- background: url(/casein/images/nav.png) repeat-x top left;
142
+ background: image-url('casein/nav.png') repeat-x top left;
143
143
  color: #000;
144
144
  }
145
145
 
146
146
  #navigation .active a {
147
- background: url(/casein/images/nav.png) repeat-x top left;
147
+ background: image-url('casein/nav.png') repeat-x top left;
148
148
  color: #000;
149
149
  }
150
150
 
@@ -169,12 +169,12 @@ div.loginBox {
169
169
  color: #fff;
170
170
  display: block;
171
171
  padding: 12px 12px 10px 12px;
172
- background: url(/casein/images/visitSiteNav.png) repeat-x top left;
172
+ background: image-url('casein/visitSiteNav.png') repeat-x top left;
173
173
  text-decoration: none;
174
174
  }
175
175
 
176
176
  #altNavigation li a:hover {
177
- background: url(/casein/images/visitSiteNav.png) repeat-x bottom left;
177
+ background: image-url('casein/visitSiteNav.png') repeat-x bottom left;
178
178
  color: #000;
179
179
  }
180
180
 
@@ -189,7 +189,7 @@ div.loginBox {
189
189
  width: 312px;
190
190
  padding: 0 0 0 6px;
191
191
  height: 100%;
192
- background: url(/casein/images/rightNav.png) repeat-y top left;
192
+ background: image-url('casein/rightNav.png') repeat-y top left;
193
193
  z-index: 10;
194
194
  }
195
195
 
@@ -205,19 +205,19 @@ div.loginBox {
205
205
  #rightBar li a {
206
206
  display: block;
207
207
  width: 288px;
208
- background: url(/casein/images/rightNavButton.png) no-repeat top left;
208
+ background: image-url('casein/rightNavButton.png') no-repeat top left;
209
209
  padding: 11px 0 11px 0;
210
210
  color: #555;
211
211
  text-decoration: none;
212
212
  }
213
213
 
214
214
  #rightBar li a:hover {
215
- background: url(/casein/images/rightNavButton.png) no-repeat bottom left;
215
+ background: image-url('casein/rightNavButton.png') no-repeat bottom left;
216
216
  color: #000;
217
217
  }
218
218
 
219
219
  #rightBar .active a {
220
- background: url(/casein/images/rightNavButton.png) no-repeat bottom left;
220
+ background: image-url('casein/rightNavButton.png') no-repeat bottom left;
221
221
  color: #000;
222
222
  }
223
223
 
@@ -18,7 +18,7 @@ module Casein
18
18
  end
19
19
 
20
20
  def create
21
- @casein_user = Casein::User.new params[:casein_user]
21
+ @casein_user = Casein::User.new casein_user_params
22
22
 
23
23
  if @casein_user.save
24
24
  flash[:notice] = "An email has been sent to " + @casein_user.name + " with the new account details"
@@ -38,7 +38,7 @@ module Casein
38
38
  @casein_user = Casein::User.find params[:id]
39
39
  @casein_page_title = @casein_user.name + " | Update User"
40
40
 
41
- if @casein_user.update_attributes params[:casein_user]
41
+ if @casein_user.update_attributes casein_user_params
42
42
  flash[:notice] = @casein_user.name + " has been updated"
43
43
  else
44
44
  flash.now[:warning] = "There were problems when trying to update this user"
@@ -58,7 +58,7 @@ module Casein
58
58
  @casein_page_title = @casein_user.name + " | Update Password"
59
59
 
60
60
  if @casein_user.valid_password? params[:form_current_password]
61
- if @casein_user.update_attributes params[:casein_user]
61
+ if @casein_user.update_attributes casein_user_params
62
62
  flash.now[:notice] = "Your password has been changed"
63
63
  else
64
64
  flash.now[:warning] = "There were problems when trying to change the password"
@@ -76,7 +76,7 @@ module Casein
76
76
 
77
77
  @casein_user.notify_of_new_password = true unless @casein_user.id == @session_user.id
78
78
 
79
- if @casein_user.update_attributes params[:casein_user]
79
+ if @casein_user.update_attributes casein_user_params
80
80
  if @casein_user.id == @session_user.id
81
81
  flash.now[:notice] = "Your password has been reset"
82
82
  else
@@ -97,6 +97,12 @@ module Casein
97
97
  end
98
98
  redirect_to casein_users_path
99
99
  end
100
+
101
+ private
102
+
103
+ def casein_user_params
104
+ params.require(:casein_user).permit(:login, :name, :email, :time_zone, :access_level, :password, :password_confirmation)
105
+ end
100
106
 
101
107
  end
102
108
  end