Displaying 20 results from an estimated 100 matches similar to: "How to deserialize an array from XML"
2010 Dec 14
4
Change primary_key column name
Hi,
after changing a primary key column name, the auto-increment information
(MySQL) and sequence (Oracle) are lost. What is the correct way to rename
primary keys?
Thanks,
Gustavo
--
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
2010 Apr 05
2
Harmonizing JSON/XML serialization
The way Rails handles root nodes in JSON and XML serialization is
inconsistent. This has been discussed before:
https://rails.lighthouseapp.com/projects/8994/tickets/2584-232-activeresource-json-doesnt-send-parameters-with-root-node
This seems mostly taken care of with
ActiveModel::Base.include_root_in_json, especially if/when it ends up
in ActiveResource. However, there is also the issue of how
2009 Feb 03
3
ROXML from_xml not returning an object instance...
Hello,
I have two ActiveRecord classes. One is Route the other is Waypoints.
I have constructed an XML representation so I can use AJAX to create a
Route with all waypoints in a single create call to RouteController.
When I call Route.from_xml(xmlString) it is not returning an object -
it''s leaving the object (@route) nil, but not erroring. Any ideas?
Here''s some code:
2011 May 01
2
More detailed Test::Unit error report
Hi,
I''m starting to use Test::Unit to create unit tests for my Rails
Applications/Plugins. I don''t have much experience in Ruby Unit Testing. The
problem is that the output report is very simple and it is very difficult to
discover where is the error. Test::Unit does not show the line number of the
error and the Stack Trace printed using the --trace option does not help
either.
2006 Feb 18
5
Model methods and partial view templates
I have a method in a controller that invokes a
render :partial => ''some_partial_view''
In that view, I''m trying to access a method defined in a model, like
this;
<% for view in @an_array %>
<% local_var = view.some_method() %>
<% another_var = view.a_column_name %>
etc..
I am getting an undefined method error but the model is accessible
2006 Feb 24
6
Duplicate entry - how to check if an id exist before saving?
How do I check if an entry exists before saving?
Someone one told me to use the method find_or_create (or something like
that)
but it didn''t work because I think the version of rails that we have is
not the most recent.
I need a way to check if an id exists in the db before saving. Any
suggestions?
Thank you
--
Posted via http://www.ruby-forum.com/.
2009 May 09
0
XMLRPC raw_post getting run through Hash#from_xml
Im trying to create an api, and Im having trouble getting
ActionController to not run the raw post data through Hash#from_xml
(request.parse_formatted_request_parameters) for the XMLRPC post data.
I essentially want it to run through
XMLRPC::XMLParser::REXMLStreamParser.new.parseMethodCall(request.raw_post).
However, I can''t figure out a clever, clean way to get
2009 Jan 05
5
ROXML versus simple to_xml
How they differ?
Does the to_xml method of the classes array/hash/object is based on
ROXML lib?
As I see in http://roxml.rubyforge.org/#quickstart, roxml needs we
define the class (class Book in the guide) before to convert a object
to xml. Moreover, the method to_xml (when not using "include ROXML")
just accepts any existing object, what is much suitable.
I need to compare and tranfer
2006 May 18
2
acts_as_ferret 0.2.1
The svn repository for acts_as_ferret has just been tagged with version
0.2.1. This is the first version of aaf to support the 0.9.x branch of
Ferret.
See http://projects.jkraemer.net/acts_as_ferret/wiki
*Features*
* High speed full text search across the contents of any Rails model
class, without any hassles. The index will be kept up to date
automagically while you work with your Rails
2007 Sep 04
11
returning(...) ?
The following construct is an ActiveSupport-ism:
returning(Foo.new) do |foo|
...
end
I don''t especially like it, since it''s both more verbose and less efficient
than the direct alternative:
foo = Foo.new
...
foo
It doesn''t occur many times in Merb, so does anyone agree with me that it
should be removed?
I tried doing this (patch attached) and I find
2006 Dec 29
3
Functional test a "create" action when a validation fails
I''m trying to write a functional test of a "create" action in one of my
controllers. In the corresponding model I have a
"validates_uniqueness_of :location". In the test case I am
constructing I have the create fail with the error "Location has
already been taken". Is there a way I can write an assertion like:
assert_equal "Location has already been
2007 Sep 21
1
RESTful route gives a 500 error when Content-Type is set
I have encountered a problem with a RESTful route, I have the simple route;
r.resources :people
With a corresponding controller, when I tried to access it using
ActiveResource I get a server error, I have tracked this down to a
problem where if the header ''Content-Type: application/xml'' is sent it
errors out:
> curl -H ''Accept: */*''
2007 Feb 23
4
How can I spec this? The method gets passed a block...
I''m using Jim Weirich''s Builder library. The code I want to spec is
xml.video do
xml.id @video_id
xml.views @views
xml.date(@date.to_s) if @date
end
I''d like to mock it, rather than asserting that the XML is the right
string. I can do one spec:
specify "should create a video tag" do
@mock_builder.should_receive(:video)
2006 Mar 28
5
Anyone use .uniq! ???
could anyone by chance give me a working example of the .uniq! method?
i''ve been trying all day. any help would be much appreciated!
jon
--
Posted via http://www.ruby-forum.com/.
2010 Jul 14
1
Watermark with Ruby on Rails
To whom it may concern, a way to create watermarks with ruby on rails,
imagemagick, attachment_fu and mini-magick in Portuguese, but the code is in
English;)
http://www.woompa.blog.br/2010/07/14/adicionando-marca-dagua-nas-suas-imagens-com-imagemagick-e-mini-magick/
Tnks!
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post
2010 Apr 23
1
Combinations with restrictions
Hi!
Is there any easy/fast way to combine vectors with restrictions?
Example:
a=c(1,2,3), b=c(4,5,6), c=c(7,8,9)
I want all combinations of this 3 vectors with length=2.
Like this:
1,4
1,5
1,6
1,7
1,8
1,9
2,4
2,5
2,6
2,7
... and so on.
Thanks in advance.
[[alternative HTML version deleted]]
2008 May 24
1
to_xml for Foo::Bar active records
20 / 20 hind sight, I would probably do things different today but I
have most of my active record classes under different parent classes.
For example:
module Foo
class Bar < ActiveRecord::Base
...
end
end
The to_xml for this produces <foo/bar> .... </foo/bar>
The / in a tag name is not allowed. Questions:
1) Is this a bug?
2) If so, suggestion of what to convert it to?
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
2010 Aug 01
4
Admin interface for Rails?
Hello folks, I am currently working on a project that has to deliver
an admin interface like the Django''s one, I wanna know if you know/
recommend any gem or plugin for that.
Cheers,
Rodrigo Alves Vieira
--
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
2008 Jan 20
0
Deserialize JSON post body
I''m doing an HTTP post to my controller with an xml request body:
curl -u 53b2c:X -H "Content-Type: text/xml" -v -d
"<subscriber><full_name>Alex Egg</full_name><carrier_id>2</
carrier_id><mobile_phone>1234321843</mobile_phone><password>asdf</
password><sub_categories