[Rails-core] FormHelper and write-only fields

2010-08-27 Thread Oliver Eilhard
Hi! Until recently I used a User model with a write-only password field on it. The idea is to pick that cleartext password up, perform some salting and hashing on it and then write that to the database. So my model used a method like this: def password=(cleartext_password) @password =

Re: [Rails-core] FormHelper and write-only fields

2010-08-27 Thread Ernie Miller
FormHelper needs a read method, too. You can return a blank string if you like but you need to respond_to the field name in question. You're most likely doing something that's not playing nicely with this commit's change to value_before_type_cast:

Re: [Rails-core] FormHelper and write-only fields

2010-08-27 Thread Santiago Pastorino
I'm about to push a change related with this but definitely is not going to solve your problem. You need a database field or a field reader. Also your code doesn't work even before my commit. You can check it out ... Let's review it ... object.respond_to?(method_name + _before_type_cast) ?

[Rails-core] URL encoding when method = :get

2010-08-27 Thread Jarl Friis
Hi. I have a form that shall create a simple GET query. Therefore I have in my view (new.html.erb) % form_for(@re, :url = {:action = 'query'}, :html = { :method = :get}) do |f| % p/ %= f.label :address %br / %= f.text_area :address % p/ %= f.submit 'Get' % % end % But when

Re: [Rails-core] URL encoding when method = :get

2010-08-27 Thread Jarl Friis
Jarl Friis j...@gavia.dk writes: But when filling out with myplace and clicking on the forms submit button it creates a GET URL like this: http://test.host/query?re[address]=myplace I was wrong on this: The above string is how my browser renders the url, The actual HTTP GET request

[Rails-core] Re: Today: constant JSON::Parser not defined

2010-08-27 Thread michael.hasenst...@googlemail.com
Just FYI, to not let this question stay in the archive unanswered: turns out if I remove the gem swf_file everything works again. Further investigation revealed that the module named Parser inside that gem must have caused a conflict - commenting out use of just that module let me load the gem

[Rails-core] Arel/ActiveRecord compatibility

2010-08-27 Thread Brian Durand
I found a couple of incompatibilities between Arel and ActiveRecord where ActiveRecord handles a database structure but Arel doesn't so that calling MyModel.first works fine, but MyModel.find does not. The first problem is with non-standard SQL column types like PostGIS geometry columns on a