Displaying 20 results from an estimated 4000 matches similar to: "Drying my code .."
2007 Jan 04
0
Hpricot
Hi:
Anyone had any luck with parsing Amazon Open Search XML using Hpricot?..
I am having touble with the following types (tags with : and /) of Open
Search XML tags..i.e.
<opensearch:totalresults>81</opensearch:totalresults>
and
<link />http://cnn.com
<br /> abc, xyz etc..
I am getting the following error
link:
parse.rb:8: undefined method `innerHTML'' for
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 Sep 25
1
how to remove bogusetag by hpricot?
I have use hpricot to translate users'' input html. I want to remove
bogusetag as follows:
>>doc = Hpricot "<p> test world</b></p>", :xhtml_strict => true
=>#<Hpricot::Doc {elem <p> " test world" {bogusetag </b>} </p>}>
>>doc.to_s
=>"<p> test world</b></p>"
what I expected is
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
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
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 ?
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
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 Jan 06
1
Invalid argument - https://graph.facebook.com/19292868552
require ''rubygems''
require ''hpricot''
require ''open-uri''
doc = Hpricot(open("http://graph.facebook.com/226723089703"))
@doc = doc.to_s.gsub(/"id.+?likes":/,"").gsub("{","").gsub("}","")
puts @doc
OR
require ''rubygems''
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
2010 Aug 18
2
[Rails 3] remote_function ?
Is the remote_function still valid in Rails 3 as it seems many of the
Prototype helpers have been replaced ? (link_to_remote, ...)
where can I find any link on it ? not in the standard doc I guess ..
thanks for you feedback
--
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
2011 May 17
2
Can't dump File ... when uploading files
I am getting this error on the redirect_to command ...
I am using Rails 3 w Paperclip to upload files ( but I tried also
CarrierWave .. same error)
I tried to change the session store from cookie-based to database ..
same error
I tried to delete the params content ...
I don''t know what to try next .. any clue ?
thanks
erwin
--
You received this message because you are subscribed to
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 Nov 15
4
Need some guidance on running shell commands from my app..
During execution in my Rails web app, I need to create a virtual host
config on my Linux server, but I don''t know what would be the best way
to do it , here are the steps ( my_domain.com is fixed, only
my_subdomain is changing dynamically
1- create: /var/www/vhosts/my_domain.com/subdomains/my_subdomain/conf/
vhost.conf
ServerName mysubdomain.mydomain.com
.. content is always the
2007 Dec 01
0
mock feed
Hello generous coders,
I''m having difficulty getting a couple of tests to pass.
I have an address model which takes an address and with a callback on save
and update passes the address to google''s
geocoding service. The returned XML is parsed and saved to the address
object:
protected
def geocode_address
key = "mykey"
url =
2012 Dec 04
2
[Rails 3.2] validation on create not working
class Place < ActiveRecord::Base
validates :description, :presence => true
validates :description, :uniqueness => {:case_sensitive => true, :on =>
:create }
# also tried
# validates :description, :uniqueness => {:case_sensitive => true }, :on
=> :create
On update ( in form fields, updated label, same description )
params
2008 Apr 09
5
Peculiar Hpricot error in Rails app
Hi,
I have been stumped by this error Hpricot is generating in my rails
app. The error looks like this:
$ script/console
Loading development environment (Rails 2.0.2)
>> str = ''<p>lorem ipsum <a href="http://dolor.com/">dolor</a> sit amet.</p>''
=> "<p>lorem ipsum <a href=\"http://dolor.com/\">dolor</a>
2009 Apr 15
0
hpricot bug?
I get an error in the hpricot-gem on Windows XP sp3. I have tested
different versions of it and combined them with different versions of
sequel (including the latest of both).
The error triggers on the line when I do: require ’hpricot’.
The line that causes the error in the hpricot-gem in the file
elements.rb (line 395) looks like this:
nth = proc { |num,i| self.position == num.to_i }
What is
2006 Feb 12
0
Effect.Highlight doesn''t return to original color with many elements?
Hi guys.
Most of the time, Effect.Highlight works just fine for me. However, when
I highlight a large number of elements, the color of those elements
never returns to the original color...
As an example, consider the code at the bottom of this post. Each
element starts to fade back to original, but stops short, leaving each
highlighted.
Anyone know what might be causing this, or what I