You are here: Forums Ask a Rails expert Problem with rails 2.1.0 & its...
Posted in Forums : Ask a Rails expert
Authority 12
Posting Rating 3
Sign in to rate this post
|
hi to everyone .i am using rails 2.1.0 for my current project.in the console mode i tried to excute the statement in console mode
=> “{\”user\”: {\”text\”: \”thillai\”, \”value\”: \”1\”}}” in rails 2.1.0 its giving the model name user also but in rails 2.0.2 the results are coming as {\”text\”: \”thillai\”, \”value\”: \”1\”} as per my requirement i want results to be {\”text\”: \”thillai\”, \”value\”: \”1\”}. Is there any solution for this problem |
Authority 25
Posting Rating 50
Sign in to rate this post
|
Aha! One of the Rail 2.1 gotchas: ActiveRecord::Base#attributes does not allow filtering anymore (it does not accept :only, for example). You must do the filtering manually, with something like this: 1: def json_attributes_for(model, *attrs) Called like so: json_attributes_for(page, :id, :keyword) From: http://giantrobots.thoughtbot.com/2008/6/19/gotchas-when-upgrading-to-rails-2-1 So you will have to change the way you call it…. |
Ask a Rails expert : Use Rails to develop sites for both Designer and Programmer
Ask a Rails expert : Rails+RS232
Ask a Rails expert : Is this a good way to add Admin section
Ask a Rails expert : RSS feed maker in rails 2.1
Ask a Rails expert : Syncing with ugly legacy databases
Ask a Rails expert : juggernaut Error
Ask a Rails expert : gem "chronic" error
Ask a Rails expert : gem install error
Ask a Rails expert : need your help or views for distributed programming with ruby
Ask a Rails expert : how to refresh ruby files without restart production server