similar to: help on how append html tag

Displaying 20 results from an estimated 5000 matches similar to: "help on how append html tag"

2006 Jun 20
2
Problem with "can''t dump anonymous class Class"
I submitted this earlier, but the web forums went down and I''ve screwed up the thread, so I''m starting over. I''m trying to built a document upload system. The system has a main Document model with different subclasses for different types of documents. With the code below, if I attempt to create a Document, it works fine, but if I attempt to use one of the subclasses, I
2009 Jun 06
2
Starting an Ap: fast_xs.bundle: [BUG] Bus Error
I''m running Ruby 1.8.7, Rails 2.3.2, and Gem 1.3.4 I''m a newb, so bare with me... I''m reading Simply Rails 2. The book tells me to enter: $ rails shovell Then, $ sudo gem install mongrel Then, $cd shovell $ruby script/server However, when I type in that last bit, I get: LOTS OF STUFF/.gem/ruby/1.8/gems/hpricot-0.8.1/lib/fast_xs.bundle: [BUG] Bus Error ruby 1.8.7
2005 Apr 21
9
Screen capture, save to file
Is there anything in the utils to capture a screen ( or maybe just a window) and save to a file. I have this, but I have no idea where it came from, but it gives a corrupted image Paul # -*- ruby -*- # screen capture -- # This script runs with a Ruby/DL which is included in ruby-1.7. require ''dl/import'' module ScreenCapture extend DL::Importable dlload
2009 Apr 01
2
hpricot won't scrape! (newb question)
Hey all! Just to preface, I am fairly new to RoR, and brand new to using hpricot. I am using the following code to scrape this xpath: "/html/body/div/div[5]/div/div[2]/div[2]/div[2]" from this url: "http://www.greatnonprofits.org/" Here is my code to do so (taken from igvita.com''s related blogpost): ************* require ''rubygems'' require
2009 Mar 17
7
urgent please :HTTPS html parsing
Hi, Is there any way to extract the html code of a https:// website in hpricot. When i use hpricot to access a https:// website i receive the following error. /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'': no such file to load -- net/https (LoadError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from
2007 Jan 12
1
Single method call to retrieve the entire page in HTML?
All, Another easy question. In Hpricot, on a doc that I am using, I can do a .to_html method and retrieve the entire page. However, this doesn''t seem to work in Mechanize. My goal is to the text of the page and put it into a database to make it searchable with ferret (using the acts_as_ferret plugin in Rails). Does anyone have a good suggestion short of iterating over the entire
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>
2011 Apr 18
2
rubygems fail - require hpricot!
Hi guys, I wanted to fetch some info from webpage and use it in my db. I read hpricot is one way to do it. But the problem is I''m unable to use it with my app. For some reason after successfully installing hpricot it fails when I try to use it in the rails console. I''ve been trying to fix this for the last four-five days. I''m stumped ! I tried re-installing everything
2011 May 25
1
can't load hpricot gem in rails 3
This is in windows .. So from irb, I can load hpricot ok. (ruby 1.8.7) C:\Users\Laurence\rails-play\plug-test>irb irb(main):001:0> require ''hpricot'' LoadError: no such file to load -- hpricot from (irb):1:in `require'' from (irb):1 irb(main):002:0> require ''rubygems'' => true irb(main):003:0> require
2007 Jun 11
3
hpricot as dependency for building rspec?
It looks to me that hpricot is a dependency to building rspec: euclid% rake pre_commit (in /Users/smtlaissezfaire/ruby/projects/rspec/hpricot) rake aborted! Could not find RubyGem hpricot (>= 0.0.0) /Users/smtlaissezfaire/ruby/projects/rspec/hpricot/rakefile:9 (See full trace by running task with --trace) Let me know if I''m wrong. Otherwise, I''ll submit a patch in the docs.
2006 Jul 07
2
Testing views with Hpricot
assert_tag smells bad. Hpricot smells nice (apricotty!). Testing your views with Hpricot: http://www.lukeredpath.co.uk/index.php/2006/07/07/testing-your-rails- views-with-hpricot/ Big thanks to _why for a great little library! Feedback is appreciated. rSpec integration coming soon (hopefully!). Cheers, Luke Redpath contact@lukeredpath.co.uk -------------- next part -------------- An HTML
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 Mar 07
8
Parsing XML file with no style info with Hpricot
Hello, I''ve been trying for hours to parse an XML using Hpricot. Usually it''s not a problem. Here''s my simple code: #This works and outputs the proper xml data @url1 = ''http://www.sportingnews.com/stories/sportingnews/MLB/rss.xml'' @page1 = Hpricot(open(@url1)) <%= @page 1 %> #This does not work, and I''m scratching my head @url1 =
2006 Nov 02
5
Adding fields to a form
Is there a decent way to add a field to a form before posting it? I haven''t tried using HPricot manipulations just yet, since I can''t ever find really solid docs on hpricot.... Form#[]= doesn''t work because it first searches only pre-existing fields. I''m investigating how to write a patch now. But I thought maybe someone here might have an idea.
2006 Feb 21
5
how to include an html file?
I have a bunch of html files with partial page content. I''d like to be able to include the content of these files in my RoR views without having to change or rename them. In PHP I''d simply use include("file.html"); What is the RoR equivalent of this? render_file insists on it being an rhtml template, and render_partial requires me to rename the file. Ideally, I
2009 Jun 06
5
Rake Tasks
Hi Everyone, I just need some further help clarifying a custom rake task I''m building and the logistics of how it should be working. I''ve created a custom rake task in libs/tasks called scraper.rake which so far just contains the following: desc "This task will parse data from ncaa.org and upload the data to our db" task :scraper => :environment do # code goes
2007 Dec 10
3
Road to 0.7.0
Hey everyone, I''ve been refactoring Mechanize for an 0.7.0 release. Basically I''m trying to clean the code up and there are a few features that I think are unnecessary, but I would like to ask people first. 1) REXML as a parser. I want to remove support for REXML. I don''t use it. Hpricot seems to do everything I need. 2) 1.8.2 thru 1.8.4 support
2007 Sep 20
4
issues submitting a search form
Hello to the list and thanks to Aaron for the cool software. I''ve been fooling around with Mechanize and Hpricot for a couple of days and from the docs I''ve read, the following code SHOULD work but doesn''t. I''ve tried the same code on a couple of different sites and I get the same exception for each. Any pointers or suggestions are appreciated.
2008 Mar 23
1
redcloth gem ragel code doesn''t build in jruby
I tried to install RedCloth-3.274 in jruby (trunk) but the install failed when RedCloth tried to build the C code using mkmf: I forget whether SuperRedcloth ever did build in JRuby?? I know Hpricot (which also uses ragel which can compile to Java code) works in JRuby -- with the patch here: https://code.whytheluckystiff.net/hpricot/ticket/131) I might be confusing the two ... FYI: If you
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''