You should not use the match method in your router without specifying an HTTP method.
Match is now depreciated with rails 4. I changed "match" to "get". I figured it makes sense to only support get in these routes. Who would be posting or patching in an unknown language?
ruby
# match '*path', to: redirect("/#{I18n.default_locale}/%{path}"), constraints: lambda { |req| !req.path.starts_with? "/#{I18n.default_locale}/" }# match '', to: redirect("/#{I18n.default_locale}")
get '*path', to: redirect("/#{I18n.default_locale}/%{path}"), constraints: lambda { |req| !req.path.starts_with? "/#{I18n.default_locale}/" }
get '', to: redirect("/#{I18n.default_locale}")
DEPRECATION WARNING: Relation#update_all with conditions is deprecated. Please use Item.where(color: 'red').update_all(...) rather than Item.update_all(..., color: 'red').
It's best to just browse the gem's github repo for changes. I organize my files a little differently than default, so I don't want those changes over ride.
I'm running into an issue: the sortable order gets messed up if the users page does not match the database. This can happen if they are using an outdated view (didn't refresh page) or another user changed the order before they refreshed the page. Any idea how to resolve this? Perform a check somehow to see if the data matches the db before the sort, else redirect.?
Remove hard dependency on bcrypt-ruby to avoid make ActiveModel dependent on a binary library. You must add the gem explicitly to your Gemfile if you want use ActiveModel::SecurePassword:
ruby
gem 'bcrypt-ruby', '~> 3.0.0'
This might help others that might be staring at an Error page, wondering why that gem wasn't required. @rbates You should add it to the show notes. :)
I followed this blog entry to load custom validators from lib/validators. I also named the EmailFormatValidator to EmailValidator. It makes more sense to me. :email => true. Great screencast as always, just needs the little update about loading validators. :)
You should not use the
match
method in your router without specifying an HTTP method.Match is now depreciated with rails 4. I changed "match" to "get". I figured it makes sense to only support get in these routes. Who would be posting or patching in an unknown language?
I used Daren Serra Dias Warburton's solution to get this working in Rails 4.
Thank you.
With Rails 4 depreciating Relation#update_all, your solution worked.
Rails 4
It's best to just browse the gem's github repo for changes. I organize my files a little differently than default, so I don't want those changes over ride.
Client_Side_Validations didn't work "out of the box" with simple_form for me.
Read this helpful post: http://www.ddarrensmith.com/blog/2012/05/17/ruby-on-rails-client-side-validation-with-validation-helpers-and-twitter-bootstrap/
And get this gist to make it work: https://gist.github.com/2705324#file_client_side_validations_twitter_boostrap_simple_form.js
Screencast is awesome.
I'm running into an issue: the sortable order gets messed up if the users page does not match the database. This can happen if they are using an outdated view (didn't refresh page) or another user changed the order before they refreshed the page. Any idea how to resolve this? Perform a check somehow to see if the data matches the db before the sort, else redirect.?
ACTIVE MODEL CHANGES RAILS 3.1.1
http://weblog.rubyonrails.org/2011/10/7/ann-rails-3-1-1
Remove hard dependency on bcrypt-ruby to avoid make ActiveModel dependent on a binary library. You must add the gem explicitly to your Gemfile if you want use ActiveModel::SecurePassword:
This might help others that might be staring at an Error page, wondering why that gem wasn't required. @rbates You should add it to the show notes. :)
Also, don't forget that Rails.env is used instead of RAILS.ENV in rails 3!
Rails 3 do
I also set up my config file with defaults that are loaded into each environment to keep things DRY.
defaults: &defaults development: <<: *defaults test: <<: *defaults production: <<: *defaults
I followed this blog entry to load custom validators from
lib/validators
. I also named theEmailFormatValidator
toEmailValidator
. It makes more sense to me.:email => true
. Great screencast as always, just needs the little update about loading validators. :)Here's the snippet:
config/application.rb