Displaying 11 results from an estimated 11 matches for "inner_html".
Did you mean:
index_html
2011 Feb 22
2
tag helper
How can I add specific content inside a tag when I create it using the
tag helper? Is there an "inner_html" option?
This doesn''t seem to be working.
<%= tag(:map, :id => (@module.css_id), :inner_html =>''innerhtml'' ) %>
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, s...
2008 Oct 07
6
Hpricot loop question to read table row values
...I need to read the rows starting with the second table row, which
excludes the title of the column. Then I need to read each column''s
value.
How can I loop through each row to get each value that I need?
To read a row of values I used
(doc/"/html/body/table/tbody/tr[2]/td[1]").inner_html >> row 1 a
(doc/"/html/body/table/tbody/tr[2]/td[2]").inner_html >> row 1 b
I tried variations of each loops that would increment the table row, but
I don''t have the syntax correct for it to work.
Any ideas?
THANKS!
--
Posted via http://www.ruby-forum.com/.
--~-...
2011 Feb 20
7
Using Nokogiri to insert a <span> tag into existing text
All,
I''m using Nokogiri to handle the following problem:
I have a piece of HTML, and for certain text nodes, I need to insert
<span> tags into the text of these nodes at a certain place.
What I am doing is finding the place where I want to insert the <span>,
let''s say index X of the text node''s text, and doing the following:
1) Setting the node''s
2010 Mar 16
4
Get content from HTML element in Rails
Hey,
I''m looking for a way to get the content of my div in my Rails view. I
would like the literal HTML content, so only HTML and no Rails
I thought inner_html would work, but I get a RJS exception (TypeError:
$("content").innerHtml is not a function)
Does anyone know how I can get the content? Thanks!
In my controller I use this code:
[code]
def save_test
render :update do |page|
page[''content''].innerHTML
end...
2008 May 17
5
Help needed
...nd_save_user(data)
end
end
def retrieve_and_save_user(data)
# email address must be unique for members
@user = User.find_or_initialize_by_email(email)
# save user if not existing
if @user.new_record?
@user.country =
Country.find_by_short((data/:countryShort).inner_html)
end
end
end
---- spec -------
module XmlImportSpecHelper
def mock_xml_import
xml_file = RAILS_ROOT + "/spec/fixtures/import-member.xml"
xml = File.read(xml_file)
@xml_import = XmlImport.new
@xml_import.should_receive(:open).exactly(1).times.
wit...
2006 Jul 11
1
responds_to_parent plugin
Not sure where I can get help with this one but I getting a wierd
behavior out of safari when trying to use the responds to parent
plugin. Basically I have the following in my view:
<div class="rightsidecontentbody">
<%= form_tag({:action => "create"}, {:multipart => "true", :target
=> "frame"}) %>
<form
2007 Jul 15
3
rejected form not handled
Hello,
I have a login form on /login.php which POSTs to /dorf1.php when access is
granted and to /login.php when it is denied.
require ''rubygems''
require ''mechanize''
agent = WWW:Mechanize.new()
login = agent.get("http://server/login.php")
form = login.forms.action("dorf1.php")
form.fields[2].value = "wronguser" # login
2006 Nov 02
5
RJS error in internet explorer
hey all,
got a rails app i''m finishing up. i have a little ajax on one of my
pages where the person can choose a doctor from a drop down list and if
the doctor isn''t there they can click a link which blinds down a little
form to add a doctor. after they submit that mini-form the page updates
the div which houses the drop-down so the doctor shows up. works very
nicely IN FIREFOX.
2009 Jun 06
5
Rake Tasks
...t contains our data
def scrape_data
@rows = []
(doc/"#{@element_type}.#{@clsname}#{@childsearch}").each do |row|
cells = []
(row/"td").each do |cell|
if (cell/" span.s").length > 0
values = (cell/"span.s").inner_html.split(''<br
/>'').collect{ |str|
pair = str.strip.split(''='').collect{|val| val.strip}
Hash[pair[0], pair[1]]
}
if(values.length==1)
cells << cell.inner_text.strip...
2009 Jun 07
17
ActiveRecord Classes
I''m having a little trouble with understanding how to work out the
schematic for some of my classes using ActiveRecord when a file is in my
lib directory:
Brief example:
Here''s the outline of the files in use:
....app
........controllers
............application_controller.rb
............rushing_offenses_controller.rb
........models
............rushing_offense.rb
....lib
2011 Dec 05
12
Using nokogiri
HI,
I want to grab some information about university names, and I found
this term called "web scraping"
I search about it in google, and there are tools in ruby.
One of them is nokogiri but I''m a bit confused because it seems that
it only gets information that its already in an html or xml
I found a webpage that have a list of university names as a
<select>