Ruby on Rails: 404 apache htaccess passenger phusion redmine ruby enterprise edition troubleshooting
by bseanvt
leave a comment
Installing RedMine PM Software on Apache with Phusion and REE and Seeing a 404 Page Not Found Error on Installation
If you follow the instructions on how to install the Rails Redmine PM Software (available here) and are using Apache with Passenger (REE), you need to delete the .htaccess file that is kept in RAILS_ROOT/public directory. Otherwise you’ll see a 404 page not found error. Took me a while to hunt this down. I stopped thinking about .htaccess in Rails apps but I guess REE+Passenger isn’t the default deployment yet.
Ruby on Rails: attr_accessor forms getters Rails setters troubleshooting validations virtual attributes
by bseanvt
leave a comment
Trouble Using Attr_Accessor in Rails Models and Forms
You might use the attr_accessible method to create getters and setters for a class that has attributes which don’t map directly to corresponding fields in a database. For example let’s take the scenario where you are processing a credit card transaction. You don’t want to save the credit card details, such as card number and verification value etc, however you still want to use these attributes in a form and you want to perform validations on them.
class CreditCardPurchase < ActiveRecord::Base attr_accessor :number, :cvv end
The only probem that I’ve run into is using the attr_accessor on datetime select form fields. Rails won’t be able to determine the “klass” and will spit out a nasty error. Looks there is some discussion around this bug. I’ve got another post about this topic http://seanbehan.com/ruby-on-rails/problem-slash-bug-in-rails-with-attr_accessor-and-datetime-select-fields/ but unfortunately not a whole lot of resultion :(


