Displaying 20 results from an estimated 10000 matches similar to: "What does ''h'' do?"
2006 May 30
7
Stripping HTML tags from a string
Hello,
Is there a common way of stripping html tags from a string? Right now I''m
just calling gsub!(/<.*?>/, ''''), but with a background in PHP and always
having used its strip_tags() method, I wonder if the Rails community has
standardized this fairly common task with something a bit less simpleminded
than my quick fix.
Thanks!
Zack
-------------- next part
2005 Dec 15
2
.rhtml in the model rather than the controller
Hi, I''m developing a mini-programming language for research surveys.
[code]
question S1 {
label: The first few questions are just to help us categorize you.
label: Do you or does any member in your household work for... (MARK
ONE ONLY FOR EACH.)
grid {
col {
1 Yes
2 No
}
row {
1 An advertising agency
2 A public relations company
3 A marketing research firm or
2006 Jan 27
10
html special characters. h() failure.
I was trying to convert a some text with the (r) character it so it
replaced character \xAE with ®
h(@item.description) didn''t do anything. I need to use
@item.description.grep(/\xAE/,''®'') for it to work.
I think the h() function should be able to do all the codes that are
available.
Regards Neil.
2006 Jan 22
9
ERROR: undefined method `h'' for ERB::Util:Module
ERROR: undefined method `h'' for ERB::Util:Module
i get above error when i use
ERB::Util.h(content)
in my controller''s action.
can any one one tell me how to use this ''h'' method within controller?
thanks,
Jigar Gosar
http://jigar.org
--
Posted via http://www.ruby-forum.com/.
2006 Sep 20
2
Defining function in template files?
Hi,
Is it possible to define a function in a template file?
For example, I thought it might be a good idea to define my Debian
systems'' /etc/apt/sources.list files based on what level of stability
and freeness a system should have. So I have this puppet code:
#---------- apt.pp ----------------
define apt-sources-list
2006 Sep 08
1
A quick guide to Mocha
Hello :)
Having just gone through the (admittedly simple) API of Mocha to learn
how it works, I wrote a quick guide (190 lines) to help others get up to
speed. I''ve attached it as RDOC and as HTML.
It is a first draft - please help me improve by giving feedback !
Contents :
Overview - Quick overview of Mocha
Unit testing, mock object and stubs - Very quick introduction to mock
2012 Sep 09
2
What module are the <% %> and <%= %> defined in?
What module of ActionView are the <% %> and <%= %> defined in?
--
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 group, send email to
2006 Feb 09
1
How to use url_escape in controller?
I know one can use <%=u "a string" %> to use the url_escape function in ROR and convert "a string" to "a%20string"
I tried using url_escape and u in my controller but none of them work and I get a function unknown error.
Can anyone please guide me as to how I can use the url escape function in my controller?
I appreciate your help
Thanks
2011 Feb 09
16
rails 3.0.4 broke yield :javascript ?
hello,
I have today updated my rails app to 3.0.4 security release but now this
yield :javascripts
fails in the layout and I get my custom js escaped as text in the view.
anybody seeing this also?
tia,
jk
--
www.least-significant-bit.com
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to
2006 Apr 28
1
Beginner Question - <% ... %>
Regarding: <% (some code) %>
I have some suspicions/general ideas about what this contruct is
supposed to do, but can someone
a) tell me what it''s proper name is and
b) explain or point me to a resource which defines it in a formal way?
Thanks in advance,
Bihal
--
Posted via http://www.ruby-forum.com/.
2007 Apr 26
5
class parameters
Hello there,
Just wanted to know if class will be able to have parameters ?
Right now i use:
define resolver( $options =''rotate'', $nameserver,
$search='''',$domain='''',$sortlist=''''){
file{ ''/etc/resolv.conf'':
content =>
2006 Jan 18
4
Ruby "htmlentities" replacement: code review please!
Hi Railers,
For some time now I''ve been looking for a decent Rails equivalent of PHP''s
"htmlentities" command, because ERB''s html_escape (or more commonly called as
just "h", eg. <%=h @somevariable %> ) just doesn''t go far enough for me.
Back in PHP land, I actually had an extended version of the htmlentities
command to deal with
2007 Mar 21
6
Converting Rails app to desktop with XUL?
Hi,
We are thinking about choosing Rails as our weapon of choice for our
next project, which is basically a text editor on steroids, whith some
functionality that need an Internet connection.
In the first step we are going to develop it as a plain web app
(AJAX-ified, yay!), however, in the next step we would like to port some
of the functionality (such as the editor) to a desktop app (which can
2006 Aug 14
3
php include() equivalent
Is there an equivelent ruby function that is similar or exactly the same
as the php include() function? I would like to be able to include a
header for my RoR web application that refers to a url. Thanks!
-Gilles
--
Posted via http://www.ruby-forum.com/.
2006 Apr 08
5
What is the h for?
In the "Agile Web Development with Rails" book it runs through making an
example application, a shopping cart.
In one of the views files, there is one line of code I dont understand
(below), I dont know what the "h" is for, also I took the h out, and it
did not affect the application (as far as i could see).
<%= h(product.title) %>
Can anyone shed some light on this
2006 Jan 25
11
Executing Ruby code that is inside a string
I would like to put Ruby code inside a string, between <%= %> tags, and
have the code inside the tags executed when the string is displayed. Is
this possible?
--
Posted via http://www.ruby-forum.com/.
2009 Jan 28
6
Creating an object from a pp string?
When I use pp on an object in rails, it prints out a nice string
representation of the object. I am trying to pass objects from one
server to another and I am wondering if I can just pass this string and
create an object on the other server. Any libraries/functions out there
that can do this? Or any other way to do this (not necessarily using
pp).
Thanks!
--
Posted via
2010 Mar 18
3
Sending mail using action mailer
Hi everyone,
I am new to ruby and i just wanna send an email using ruby action
mailer. i have been trying it for about a day. Not achieved. so many
replies came in from google but many were beating the bushes ..
can any one send me a correct procedure..
regards
ds
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
2012 Oct 20
5
Is it possible to store the log file by day?
I hope to store the log file by day , because the log file will be so large
with the time goes by.Is it possible to do this ?
--
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 group, send email to
2013 May 07
2
Net::HTTP
I''m looking at the documentation:
http://ruby-doc.org/stdlib-2.0/libdoc/net/http/rdoc/Net/HTTP.html
And I notice two uses of Net::HTTP. Both are using GET requests. But
what''s the difference? When to use which?
Net::HTTP.start(uri.host, uri.port) do |http|
request = Net::HTTP::Get.new uri
response = http.request request # Net::HTTPResponse object
end
uri =