On Jul 28, 5:53 pm, Michael José <li...@ruby-forum.com> wrote:
> Hi there fellows !
>
> I'm currently working on a JSon view and had to make my own view (for
> simple ActiveSupport::JSON can't do the trick anymore).
>
> The thing is, after my controller does this :
>
> respond_to
>   format.html
>   format.json
> end
>
> It does use the correct view in the correct context. Yet, the json view
> is filtered and the unsupported characters of HTML are modified.
>
> So this is pretty much what I get :
>
> {&quot;created_at&quot;:&quot;2011-07-28T15:38:36Z&quot;}
>
You're probably being tripped up by rails's automatic html escaping
What's in your view file?
It seems unlikely that you need to go down the root you're going down
- you can build whatever hash you need and then render it as json with
render :json => some_hash.

Fred
> When all I really wanted was :
>
> {"created_at":"2011-07-28T15:38:36Z"}
>
> What's up with that ? How may I prevent this filtering to happen ?
>
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to