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 0
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 49
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 : copy to clipboard
Ask a Rails expert : API call problem
Ask a Rails expert : Invoke a plugin from a plugin?
Ask a Rails expert : Restful problem
Ask a Rails expert : Problem with form for ActiveResource model
Ask a Rails expert : Paypal(How to set u/p)
Ask a Rails expert : MySQL for Production?
Ask a Rails expert : Git for Windows