How to add confirm message with link_to Ruby on rails

I might be mistaken but you don’t specify a controller along with the :action option. Have you tried the following? Assuming you have a messages resource configured in your route: link_to ‘Reset’, message_path(@message), :confirm => ‘Are you sure?’ EDIT: Above is deprecated. Rails 4.0 now accepts the prompt as a data attribute. See the doc … Read more

Weird issue with devise valid_password?

This issue is due to a known string-corruption bug in Ruby 2.2.0 that was fixed in 2.2.2. As described in the bug report, the corruption occured when BCrypt called a specific string-creation API from its C extension, which Devise v3.3.0 triggered by calling ::BCrypt::Engine.hash_secret from the Devise::Models::DatabaseAuthenticatable#valid_password? method. A Devise-specific workaround for this bug was … Read more

Adding a custom seed file

Start by creating a separate directory to hold your custom seeds – this example uses db/seeds. Then, create a custom task by adding a rakefile to your lib/tasks directory: # lib/tasks/custom_seed.rake namespace :db do namespace :seed do Dir[Rails.root.join(‘db’, ‘seeds’, ‘*.rb’)].each do |filename| task_name = File.basename(filename, ‘.rb’) desc “Seed ” + task_name + “, based on … Read more