Displaying 20 results from an estimated 10000 matches similar to: "AJAX slow - to_json responsible?"
2009 Oct 28
2
How to send a html email with attachment
Hi guys:
I wanna send a html format email with a attachment.
What I do is like:
model:
def weekly_report
address = WeeklyReportEmail.find_all_by_validate(true).collect(&:address).to_sentence(:last_word_connector
=> '','', :two_words_connector => '','')
@recipients = address
@from = "Chronos weekly report
2010 Jul 14
3
`stack level too deep` when overwriting `to_json`
I''m using
[acts_as_commentable_with_threading](http://github.com/elight/acts_as_commentable_with_threading/),
and it worked fine until I tried to overwrite the to_json function to
include more details about the associated user.
Here''s part of the comment class (which was originally defined in the
plugin, but I moved it to the models folder, a move which seems not to
affect the
2010 Jun 10
4
rails removes newlines and spaces from ajax requests
Hi
I have an app which posts an ajax request with with text area content,
but when it does post it it gets all the newlines and multiple spaces
removed (need to use multiple spacing for use with markdown code
snippets)
I''ve created a sample app which you can see here http://test.42horizons.com/test,
View it in IE 8 and both requests remove line spaces and new lines,
view it in firefox
2009 Jun 14
3
Basic AJAX Response (Mootools)
Hi,
I''ve done AJAX calls to Rails'' Controllers before yet never required to
generate a response back to the view. In this respect, I have tried to
keep it moronically simple and just add a node to see that it works, yet
the response doesn''t come through / isn''t interpreted as it should. Long
story short, code :
// Have to use Mootools to integrate a
2009 Feb 23
2
to_json problem (Rails2.2.2)
Hi all,
i got a record from my project server side database, like this :
@user = User.find 1
then i cover @user to json format:
@user.to_json
the result :
"created_at": "2009-01-28T12:29:32Z"
what''s the T and Z of created_at field ?
but i change Rails 2.2.2 to Rails1.1.6,
I got :
"created_at":
2007 Oct 23
2
to_json inconsistency?
Hello,
ActiveSupport::JSON::Variable.to_json is the only to_json without an
"options" parameter. Is this intended?
For example, this code in a .rjs
page[@user.dom_id].visual_effect :drop_out, :afterFinish =>
ActiveSupport::JSON::Variable.new("foo")
fails with
ActionView::TemplateError: wrong number of arguments (1 for 0)
On line #7 of
2010 Jun 08
8
rails, ajax, json, and script
Could someone please demonstrate the code to send both json (or xml) AND
javascript (to be executed) in a single Ajax request?
Is this even possible?
--
Posted via http://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
2012 Jan 27
2
to_json performance
Originally posted on github, reported to the right place.
I would like to open a discussion about how `to_json` and `as_json`
operates in Rails from a performance standpoint.
I''m using Rails 3.2 but this issue applies to almost all versions of
Rails.
Our use case presents the challenge in sending out potentially large
JSON (or XML, but we''ll focus on JSON rendering here)
2010 Feb 20
1
Advanced use of to_xml and to_json
Hello,
I''m working on a Rails app which has a REST API. I manage two formats
JSON and XML.
Very often to simplify the use if the API, I''m making includes. But when
you add params to to_json and to_xml like :only, :except, it''s not only
applied on the root object but on all the objects included.
Do you know libs or methods to answer to these different problems:
* Tell
2005 Oct 17
7
Ajax.MultiUpdater ?
Hi,
I''m using prototype within ruby on rails.
One limitation I''d like to overcome is the restriction of beeing able to
update just one html elements content using from_remote_tag or
link_to_remote.
AFAICS this is just a restriction of the form_remote_tag/link_to_remote
implementation and it''s underlying Ajax.Updater class. Right?
In theorie there should be no problem,
2007 Mar 28
7
Rails, REST and JSON
Hi everyone,
I''m writing a lightweight AJAX application using Rails on the server side as
a RESTful web service provider.
I need the web service to support both JSON and XML I/O. Outputting data in
XML and JSON is easy (using to_xml and to_json),
and it''s also easy to do XML input as Rails does it for you automatically.
Is it possible to somehow have the same
automatic parsing
2007 Dec 27
5
Rails 2.02 dropped JSON attribute tag ?
Hey there
I was scratching my head over why my application breaks when I run on
a local server but works on my remote server. It turns out that my
local server is Rails 2.0.2 and my remote server is 1.2.3 and I expect
the tag "attributes" to be passed with a json stream, before parsing.
Unfortunately, this was dropped in 2.0.2. Is there any documentation
on this? Any way to get it back?
2010 Jan 18
7
Ruby Array to Java Script Array
Hi,
How can we use an array created in Ruby in Java script ?
Regards,
Prashant
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
2020 Aug 28
4
[PATCH] drm/nouveau: bail out of nouveau_channel_new if channel init fails
Unprivileged user can crash kernel by using DRM_IOCTL_NOUVEAU_CHANNEL_ALLOC
ioctl. This was reported by trinity[1] fuzzer.
[ 71.073906] nouveau 0000:01:00.0: crashme[1329]: channel failed to initialise, -17
[ 71.081730] BUG: kernel NULL pointer dereference, address: 00000000000000a0
[ 71.088928] #PF: supervisor read access in kernel mode
[ 71.094059] #PF: error_code(0x0000) - not-present
2007 Dec 11
0
help for hash.to_json
hi , all
under rails 2.0
aotianlong@aotianlong:~/workspace/killer$ ruby script/console
Loading development environment (Rails 2.0.1)
>> {:user=>"aotianlong"}.to_json
=> "{\"user\": \"aotianlong\"}"
>> user = User.find :first
=> #<User id: 1, uname: "aotianlong">
>> user.to_json
=>
2011 Apr 17
0
newbie: to_json only/except + association confusion
hi,
i want to return to_json with ''only'' and also filtered.so i tried
various ways, but none of them are really good:
A)#OK , but filter missing
format.json { render :json => @project.to_json(:only =>
[:title ], :include=> { :tasks => {:only=>[:id,:title] } } ) }
B)#Not OK > filter does not work,
format.json { render :json => @project.to_json(:only
2013 Jan 07
0
Simplified to_json method API
Sometimes to_json options feels abusing to me:
user.to_json(:only => [:id, :name], :methods => [:something])
I would prefer an API like this instead:
user.to_json(:id, :name, :something)
What do you think about adding a use case like this to to_json?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this
2009 Aug 07
0
How to specify ActiveRecord's to_json encoding
Question:
Hi, our company is using Ruby 1.8.6 with Rails 2.2.2. Does anyone
know we can explicitly specify what encoding to use when calling
to_json() or to_xml() methods?
Problem:
We have some multibyte characters in our database. For example we
have a table with a name column that has this French accented e: Café
Records. When we serialize this object using ActiveRecord''s to_xml()
2013 Jan 07
0
Simplified to_json usage
Sometimes default json options feels abusing to me:
person.to_json(:only => [:id, :name], :methods => [:something])
I would like to be able to call something like this for AR objects
person.to_json(:id, :name, :something)
What do you think about extending to_json API with this use case?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2008 Jul 12
0
to_json in Rails 2.0.2 not generating proper json?
I am using Rails 2.0.2 and trying to use to_json to generate json. I
notice several problems.
1) datetime field such as created_at mapped to "created_at": {}
2) :except does not work, @post.to_json(:except =>
[:created_at, :updated_at] still gives me "created_at": {},
"update_at": {}
3) problem with escaped char mapping: ''<'' mapped to