Displaying 20 results from an estimated 400 matches similar to: "How to search and replace all urls on a HTML string using RUBY gsub"
2009 Mar 30
4
Displaying HTML code in view
Hi,
In my application i have the facility for the users to upload the file
which has code ...
And when i want to view the contents of the file uploaded in my view,in
case if the uploaded file is an html file then i am not able to display
the exact code...Instead the html content in that code gets executed.
if i have uploaded example.html
<html>
<head>
2010 Feb 02
3
Generating a PDF using popen and wkhtmltopdf
As described on wkhtmltopdf Google group
(http://code.google.com/p/wkhtmltopdf/issues/detail?id=162), I have a
problem generating a PDF while using popen and wkhtmltopdf.
wkhtmltopdf takes HTML code as input and ouputs a PDF file. Here is what
I''m doing:
command = ''"C:\Program Files\wkhtmltopdf\wkhtmltopdf.exe" - - -q''
IO.popen(command,
2006 Jan 30
4
How to encode URLs?
How does one encode URLs in ROR?
Thanks
Frank
---------------------------------
Bring words and photos together (easily) with
PhotoMail - it''s free and works with Yahoo! Mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060130/60280869/attachment.html
2011 Aug 14
6
[PATCH 1/6] out-of-tree build: fix documentation generation
---
cat/Makefile.am | 6 +++---
df/Makefile.am | 2 +-
edit/Makefile.am | 2 +-
examples/Makefile.am | 12 ++++++------
fish/Makefile.am | 18 +++++++++---------
fuse/Makefile.am | 2 +-
inspector/Makefile.am | 2 +-
java/examples/Makefile.am | 6 +++---
ocaml/examples/Makefile.am | 6 +++---
2009 Mar 22
0
gsub('(.).(.)(.)', '\\3\\2\\1', 'gsub')
there seems to be something wrong with r's regexing. consider the
following example:
gregexpr('a*|b', 'ab')
# positions: 1 2
# lengths: 1 1
gsub('a*|b', '.', 'ab')
# ..
where the pattern matches any number of 'a's or one b, and replaces the
match with a dot, globally. the answer is correct (assuming a dfa
engine).
2009 Mar 22
0
gsub('(.).(.)(.)', '\\3\\2\\1', 'gsub') (PR#13617)
Full_Name: Wacek Kusnierczyk
Version: 2.10.0 r48181
OS: Ubuntu 8.04 Linux 32bit
Submission from: (NULL) (129.241.199.135)
there seems to be something wrong with r's regexing. consider the following
example:
gregexpr('a*|b', 'ab')
# positions: 1 2
# lengths: 1 1
gsub('a*|b', '.', 'ab')
# ..
where the pattern matches any number of
2012 Sep 30
3
How to escape a forward slash with gsub, also does interpolation work with gsub?
I am trying this:
I want to replace all the text in between java comments:
/* start */
replace this text here
/* end */
I''m trying:
text.gsub(//* start */(.*)/* end *//im, replace_with)
But i''m getting errors relating to expecting keyword_end.
How should I be escaping /* and */ ?
Also, does string interpolation work in gsub regex? Say I had variables
like:
start_tag =
2013 Jan 09
4
[PATCH] doc: fix out-of-tree build
It seems the mail you are referring to never made the list: it's not in
the archives and not in my mailbox. Take a look here:
http://lists.xiph.org/pipermail/flac-dev/2012-December/thread.html It's
probably still waiting for moderation.
On 07-01-13 17:07, Olivier BLIN wrote:
> On 29/12/2012 00:06, Olivier Blin wrote:
>> When building outside of the source tree, the Doxyfile
2005 Dec 14
3
Advanced routing question.
Hello All,
I''m making a quick application that tracks outgoing links to referral
sites. I need to track the user and the url they went to so the
easiest way would be to take the entire url as a parameter and log
that into the database. I was wondering if I could do something like
this with routing:
http://www.example.com/user/jump/http://www.myvendor.com/referral.php?
2008 Dec 13
2
Need Help in converting php encryption decryption code to ruby on rails
Hi guys i found this encryption decryption in php and try to convert
it in rails but i am unable to successfully convert it. So plz help
me. I you write the whole conversion code then it will be great.
PHP code is like this
================
#
#/**********************************************
#**
#** MD5 block cypher
#**
#** Author..: leapinglangoor [
2006 Jul 31
2
The error occured while evaluating nil.gsub!
#{RAILS_ROOT}/app/controllers/start_controller.rb:13:in `create''
---
class StartController < ApplicationController
def create
#------------Remove Tag---------------------------
@name = params[:name]
@file = params[:filepath]
@file = @file.gsub!(/^.*(\\|\/)/, '''') # replace html tags with blank
post = Post.save(@params["removetag"])
end
end
--
2006 Mar 22
0
Private method gsub Error
Hi,
I keep getting this error when trying to use a condition in one of my habtm.
I''ve used conditions in habtm before in other projects and they work fine. Now I''m getting this:
private method `gsub'' called for ["user_id = ?", "1"]:Array
This is what I''m doing.
has_and_belongs_to_many :TenSpeed, :class_name => "Bike",
2006 Jan 10
0
auto_link generating error (nil.gsub) in functional test
Hi everyone,
When running tests, I get this error for running auto_link on a set of
column data:
test_list(PersonnelControllerTest):
ActionView::TemplateError: You have a nil object when you didn''t expect it!
The error occured while evaluating nil.gsub
On line #28 of app/views/personnel/list.rhtml
25: <tr valign="top" class="<%= alternate_rows
2008 Oct 08
2
private method `gsub' called for 2:Fixnum
RoR Error: “private method `gsub'' called for 2:Fixnum”
I am new to RoR and trying to complete “RailsSpace Social Networking”
example, all works fine until I have implemented cookies using
authorization_token, and start getting following error when trying to
login.
“private method `gsub'' called for 2:Fixnum”
I can make out that there is something related to String conversion
2011 Jul 04
1
puppetlabs-firewall gsub error
Hi,
I am testing https://github.com/puppetlabs/puppetlabs-firewall and get
this error:
err: Could not prefetch firewall provider ''iptables'': private method
`gsub'' called for nil:NilClass
I don''t know ruby so any help appreciated!
--
Bjørge Solli
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
2009 Nov 03
2
R 2.10.0: Error in gsub/calloc
I'm running R 2.10.0 under Mac OS X 10.5.8; however, I don't think this
is a Mac-specific problem.
I have a very large (158,908 possible sentences, ca. 58 MB) plain text
document d which I am
trying to tokenize: t <- strapply(d, "\\w+", perl = T). I am
encountering the following error:
Error in base::gsub(pattern, rs, x, ...) :
Calloc could not allocate (-1398215180 of
2009 Nov 10
2
gsub does not support \b?
Hello, can someone help? How come
> gsub("\bINDS\b","INDUSTRIES","ADVANCED ENERGY INDS")
[1] "ADVANCED ENERGY INDS"
not ADVANCED ENERGY INDUSTRIES
Thanks.
Richard
[[alternative HTML version deleted]]
2009 May 29
1
tests problem - NoMethodError: private method `gsub' called for 117681882:Fixnum
Hi,
i got very strange problem connected to tests in Rails. I got the same
application code version as my team has, and on their computer all tests
pass, and on my laptop (debian 5, ruby 1.8.6/1.8.7 (tried both), rails
2.3.2) i got more then 50 errors - majority of them is variations of
"NoMethodError: private method `gsub'' called for 117681882:Fixnum" error
in controller.
2001 Aug 02
0
gsub() and parenthesis symbols -- solved
Hello again --
inevitably, I discovered the (documented) answer 30 seconds after
sending my question.
Using gsub(...,extended=FALSE) is the way to avoid this issue.
Cheers,
Kieran
--
Kieran Healy, Assistant Professor,
Sociology Dept, University of Arizona.
kjhealy at u.arizona.edu :: (520) 621-3480
http://www.u.arizona.edu/~kjhealy
-------------- next part --------------
An embedded message
2011 Apr 29
1
regular expression in gsub() for strings with leading backslash
Hello,
Can anyone help on gsub() in R? I have a string like something below, and
wanted to delete all the strings with leading backslash, including "\xa0On",
"\023, "\xab", and many others. How should I write a regular expression
pattern in gsub()? I don't care how many characters following backslash.
txt <- "Is This Thing\xa0On? http://bit.ly/jAbKem