Displaying 20 results from an estimated 10000 matches similar to: "how to serialize an xml node"
2011 May 20
5
views w locale default template
[RAILS3]
I hesitate on how handling the locale view templates to default to
one language only ..
sending admin emails will go only to one locale ''en_GB''
should I set it up into the template name and set I18n.locale to
''en_GB''
membership_renew.en_GB.html.erb
OR
whatever locale is used , if I have :
membership_renew.html
it will be the default ?
--
2011 May 16
2
Cannot get multipart => true , running well in my form when using remote => true
I have a simple form , with a file field
= form_for (Clip.new), :html => {:multipart => true} , :remote =>
true , do |f|
= f.hidden_field :user_id, {:value => current_user.id}
= f.text_field :name
= f.text_area :description
= f.file_field :image
= f.submit I18n.t(:add)
generating the html code
<form accept-charset="UTF-8"
2011 Apr 23
3
Rails3 how to scope it, using a serialized array ?
giving a simple model, with a serialized Array attribute
class Instructor < User
..
serialize :languages, Array
I am looking in defining scopes like this :
>scope speaking_english, lambda { where("languages ... includes.... ?", :en) }
which look for instructors in which the languages array include ":en"
Is this kind of scope possible ? or not.... ( just using
2010 Oct 31
0
Loading xml document using Nokogiri and retrieving CDATA element
This is an extension of my last post (problems with REXML) which has me
looking to Nokogiri again. The reason I am not using Nokogiri is I can not
seem to find a way to get CDATA out of a Nokogiri document.
First, can you tell me if I am loading my document correctly, because when I
call my_document.to_xml, I only get one line back:
(rdb:1) test_file = Nokogiri::XML(mismo_xml_file)
2008 May 05
0
Changing ActiveRecord serialize format to XML instead of YML
Hello,
So far, ActiveRecord serialize is working great for me to save
arbitrary data.
I would like to know if there is a way to change the format of
ActiveRecord serialize to XML instead of YML.
I like the readability of YML, but I need to search serialized fields
in the database.
So, it would make sense to use XML because most database vendors
supports XML value extraction, e.g,. ExtractValue
2013 Jun 04
3
Nokogiri::XML methods example
Hi,
I am not able to find out a simple example to find out the how the
method works:
> Nokogiri::XML::EntityReference::new
(http://nokogiri.org/Nokogiri/XML/EntityReference.html#method-c-new)
> Nokogiri::XML::Document#canonicalize
(http://nokogiri.org/Nokogiri/XML/Document.html#method-i-canonicalize)
Thanks
--
Posted via http://www.ruby-forum.com/.
--
You received this message
2012 Oct 16
8
<form> tag is self-closing before input fields .. (HAML generator used)
The form is inside a table, enclosing a <tr>
= form_tag admins_backoffice_dashboards_path, :remote =>"true" do
%tr.search
%th= link_to t(:clear), "#", :id => :clearFilter
%th= select_tag :role,
options_from_collection_for_select(Role.global, :id, :name, :selected
=> @role_id )
%th= text_field_tag :email, nil, :value
2009 Oct 21
4
XML file using Nokogiri gem
Hello friends,
Can you guys give me some idea about how to Create XML file using
Nokogiri gem.
--
Posted via http://www.ruby-forum.com/.
2010 Aug 12
4
[Rails 3] How to test routes urls in console
I tried require ''url_writer''
but this is not the trick
what should be required/included to test the routes urls ?
thanks
erwin
--
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
2009 Jun 25
4
standard ActiveRecord validation message
in testing my app I just use the validations
validates_presence_of :first_name, :last_name, :email
validates_presence_of :academy, :message => "You must select an
Academy"
validates_presence_of :role, :message => "You must select a role"
standard error_messages are fine for most of my fields , resulting
in :
5 errors prohibited this data from being saved
There
2012 Nov 09
8
method conditional option pattern
When I have this pattern
sign_me(@user, :event => :authentication, :subdomain => subdomain)
how can I write it to avoid sending the :subdomain option if subdomain.nil?
( if possible ..)
sign_me(@user, :event => :authentication #?, :subdomain =>
subdomain unless subdomain.nil? )
--
You received this message because you are subscribed to the Google Groups
2009 Oct 13
0
Re: How can I parse encoded and serialized XML with REXML?
On Sep 24, 2:14 pm, Andy <andym...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> I''ve getting data like this:
>
> <![CDATA[a:1:{i:0;s:6:"Sometext";}]]>
>
> I know in PHP I can unserialize and decode, but I''m not sure the best
> way to do it in Rails.
>
> I''m already parsing the XML using REXML so I''m
2008 Dec 13
2
how to import a dump .sql file in a rake task
I have a dump of some tables to be filled when the app is setup
''.../db/dataset/regions_dpt_cities_codes.sql''
I would like to execute a task similar to the >mysql source
<dump_file>
like :
ActiveRecord::Base.connection.execute("source #{path};") (which
doesn''t run fine, of course....
is it possible in a rake task ? if yes, any suggestion ?
2014 Nov 10
1
subscripting a data.frame (without changing row order) changes internal row.names
Dear R-devel,
Can anyone help me to understand this? It seems that subscripting the
rows of a data.frame without actually changing their order, somehow
changes an internal representation of row.names that is revealed by e.g.
dput/dump/serialize
I have read the docs and inspected the (R) code for data.frame,
rownames, row.names and dput without enlightenment.
df=data.frame(a=1:10, b=1)
2012 Mar 26
3
render :json not sending any data back ...
[rails 3.2.2]
I perform an ajax call :
...
$.ajax
url: " /backoffice/expenses/rate"
type: "GET"
dataType: "json"
data:
project_id: $(''#project_id'').val()
code: $(this).val()
success: (result) ->
alert result
$(''#expense_price'').val(result)
in
2009 Feb 09
2
dynamic constant assignment
I have a constant set up like that :
ALL_LOCALES
=> {"it"=>"Italian", "fr"=>"Français", "de"=>"Deutsch", "en-
GB"=>"English (UK)", "es"=>"Español (España)", "pt-PT"=>"Português",
"pl"=>"Polski", "en-US"=>"English
2007 Aug 31
1
Consistency of serialize(): please enlighten me
Hi,
I am puzzled with serialize(). It comes down generating identical
hash codes for (apparently) identical objects using digest::digest(),
which in turn relies on serialize(). Here is an example illustration
the issue:
ser <- function(object, ...) {
list(
names = names(object),
namesRaw = charToRaw(names(object)),
ser = serialize(names(object), connection=NULL, ascii=FALSE)
2010 Nov 28
2
converting xml to a OpenStruct
Hi just wondering if there is a easy way to turn an xml entity into a
object like of type OpenStruct where i can access everything like a
property?
It''s kind of like parsing xml, I already know about nokogiri, but I want
to work is a OpenStruct and not a DOM object, does that make sense? =P
--
Kind Regards,
Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely
GNU/Linux:
2011 Oct 20
2
Rails 3.1.1 why public/system content is not transferred upon deployment
Testing locally I uploaded files into public/system/... folders
( default for Paperclip)
Upon deployment ( capistrano) on the remote server, I can see a
symlink from public/system to the shared/system/ but the content
( all images ) is not transferred.... I had to do it myself via
ftp ..
Is it a standard behavior ? or did I miss adding a task in the
deployment ?
thanks for your feedback
--
2011 Feb 27
10
How to store the same key multi times in a Hash ?
given an Arra tags[]
I need to produce a resulting Hash as following ..
{ "$in" => [tags[0]], "$in" =>[tags[1], ...}
in which the key should be always the same and the value being an
Array
I tried this :
myHash = {}
tags.each do |tag|
h = {"$in" => [tag]}
myHash.merge!(h)
end
but the merge! is only