Displaying 20 results from an estimated 600 matches similar to: "[ActiveSupport] Patches needing review: re-organization of #to_query methods, preservation of XML/JSON content-type"
2007 Oct 04
4
2 more JSON / XML feature parity patches before Rails 2.0
I''d really like to see just 2 more functional changes to the JSON
serialization/encoding before we get to Rails 2.0.
First, and I think this is really crucial because without it all the
efforts to output JSON from ActiveRecord objects would have been half
in vain, is to allow us to do this in controllers:
@authors = Author.find(:all)
render :json => @authors.to_json(:only =>
2008 Jan 09
6
[PATCH] x 2 - Fix for "null pointer exception" when ask_status is called before worker is run, and docfixes
Sorry for attaching patches in emails to the mailing list, but I''m still
unable to login to Devjavu for Backgroundrb (I''m able to login just fine for
Merb''s Devjavu and submitted a ticket successfully).
Anyway, I encountered a bug when trying to #ask_status of a worker before
it''s run (or rather, before its result_hash has been set to something). Not
sure why
2007 Dec 07
9
Merb-style development exception pages for Mac OS X
I like the merb-style exception pages where there''re links to open the
files listed in the stack trace in TextMate and the source around each
line a lot so I stole the idea (and the code!) and made a patch for
Rails: http://dev.rubyonrails.org/ticket/10401
Here''s how it looks like in Merb: http://yehudakatz.com/wp-content/uploads/stacktrace.gif
What do you guys think?
2007 Sep 28
2
Rails shouldn't output invalid JSON by default
Please check out this ticket (which would explain almost everything):
http://dev.rubyonrails.org/ticket/8762
So basically, Rails to_json methods produces invalid JSON out of the
box as it doesn''t quote all hash keys. This is valid JSON:
{
"id": 6589,
"code": "SIN",
"name": "Singapore"
}
This is not (Rails'' JSON encoders
2008 Jan 03
1
Trac not for general use?
Hi devs,
I was trying to open a new ticket with a minor doc patch at the
BackgroundDrb Trac (http://backgroundrb.devjavu.com/) and it seems
like only admins have permission to do so. Is this intended?
I read in the readme that patches should be mailed to this list, but I
much prefer to use Trac since there''s already one set up. Any reason
Trac is not open to registered Devjavu users?
2012 Sep 01
4
Basic Paypal
Hi all i am following this like for basic paypal
http://railscasts.com/episodes/141-paypal-basics
and i got this error
View:
<%= link_to "Checkout", @cart.paypal_url() %>
undefined method `paypal_url'' for nil:NilClass
despite i have this code in my model called Card
Cart Model:
class Cart < ActiveRecord::Base
def paypal_url(return_url)
values = {
2007 Jan 20
2
Conditional pluralize without the number
Hi.
Assume you have an array of person names. I want to generate results in
my view that look like this:
Abby is your friend
or
Abby, Bob, and Carol are your friends.
So I''d like to say:
<%= friends.to_sentence %>
<%= pluralize(friends.count, "is") %>
your <%= pluralize(friends.count, "friend") %>
But because pluralize puts in the
2009 Feb 04
1
How to hack a mongrel cluster to restart in an alternating manner?
Hello,
I''ve been trying (unsuccessfully) to hack my mongrel_cluster to re-ststart
in an alternating manner.
Specifically, this soluiton:
http://blog.carlmercier.com/2007/09/07/a-better-approach-to-restarting-a-mongrel-cluster/#content
Which means I an call to mongrel_rails cluster::restart to do this:
mongrel_rails start 8001
mongrel_rails stop 8001
mongrel_rails start 8002
2010 Feb 18
5
Converting hash to option string
Is there a good way to programmatically convert
{:a=>''b'', :c=>''d''}
to
''a=b c=d''
?
Rails seems to do this knid of thing "all over the place".
I see reverse_merge and similar functions ... but I wonder if this is
canned behavior somewhere.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you
2007 Nov 30
5
render_to_string in an after filter
I''m using render_to_string in an after_filter, which renders a partial
that is sent to a web service. Here''s the code:
class MyController < ApplicationController
after_filter :post_to_webservice
def show
# show logic
end
def post_to_webservice
stuff = render_to_string :partial => ''stuff''
webservice_post(stuff)
end
I get a DoubleRenderError in the
2007 Nov 19
3
link_to and GET parameters
Hi,
I am trying to generate a link to external site with GET parameters
( in new window).
I tried following code, but it does not produce any parameters.
<%=link_to "Open New Page", "https://www.foo.com/page/", {:popup =>
true}, {:param1 => "value1", :param2 => "value2"}%>
and
<%=link_to "Open New Page",
2007 Oct 08
1
Can you alias fields in acts_as_ferret?
Is there any way to set a field name that is different than the method
name used to populate it?
My example:
In Rails, I''m using acts_as_ferret on a Article model that has_many
Authors. I want to be able to index authors'' names with each article.
Since @article.authors yields an array of Author objects (and not an
indexable string), I''ve created this method in my
2006 Aug 07
1
Eager loading wierdness
Consider this problem.
I have an Item that has_many Features
I want to find all Items with a Feature name of ''foo''.
Normally you would do this..
@items = Item.find(:all, :conditions=>["features.name = ?", ''foo''],
:include=>:features)
This all works fine and dandy except for this problem.
If you do this...
<% for item in @items %>
2002 May 25
2
Problem with winbind in Win2k domain
I've been trying to setup a Samba file server on our Win2k domain that
will use the users/groups from Win2k using Winbind.
I have been quite successful so far but have come up against a problem.
This is what I've done so far:
- Download 2.2.4, compiled and installed fine
- Setup winbind & added the server to the domain. All works
fine (I ca list users, groups etc)
- Setup samba
2008 Jan 02
3
Submitted a patch, got pluses, what now?
Hello Rails people,
I submitted a patch recently to get rid of an annoying exception raised when
an AR
object is created - http://dev.rubyonrails.org/ticket/10556 , had some
people review it,
got some pluses... What am I supposed to do now?
Can anybody advise or just review the patch and take care of the issue?
Thanks!
--
Best regards,
Yuri Leikind
2007 Oct 02
0
More JSON and XML feature parity for AR and ActiveSupport (patch review)
I''m really glad the JSON changes got in, many thanks to all involved,
committers and contributors alike :).
But there''s still one feature that''s missing to achieve feature parity
between the JSON and XML encoding/conversion. And that is the abililty
to say in your controller:
@authors = Author.find(:all)
render :json => @authors.to_json(:only => :name)
2004 Sep 10
1
[Flac-users] BIG Problem!!! Help please!
Yeow! I have many files that have become unplayable. They are almost (but not always) the files of
an entire CD. The error I get is FLAC_STREAM_DECODER_ERROR_LOST_SYNC. They played until recently
using WinAmp and PhatNoise. They will not decode, returning a 0 error. I recently re-installed
Windoze (XP Pro) if this might be a cause, but many of the files I had before the reinstall still
do play.
2008 Aug 27
1
redirect with multi-dimensional parameter hashes
Hi,
Is it possible to redirect passing multi dimensional parameters?
I need to send params[:current][:selview] to another action mantaining
the same data structure
if I try as follows:
redirect_to :controller=>"main",:action=>"inquiry",{"current"=>{
"selview"=>params[:current][:selview]}}
I receive "syntax error, unexpected
2011 Aug 19
1
How to post a file via HTTP as multipart/form-data to Facebook?
I would like to post a new photo to a user using `Net::HTTP::multipart`
from a Heroku application to Facebook.
I have the following JSON object:
{"message"=>"My message",
"image"=>#<ActionDispatch::Http::UploadedFile:0x00000004242490
@original_filename="neEZYMAnBI.jpg",
@content_type="application/octet-stream",
2007 Nov 20
2
Anyone using to_xml and procs...
I''m looking for comments on http://dev.rubyonrails.org/ticket/10162
In my opinion, the current behaviour is a bug, and should be fixed.
If you have a use case where passing procs to the child associations
is actually useful, chime in.
Jonathan del Strother
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups