Displaying 20 results from an estimated 3000 matches similar to: "html special char conversion"
2006 Mar 29
4
Scaffold generator: create vs. new
Can anyone supply me with a simple, succinct explanation of what the
difference is between the "new" controller and the "create" controller
that the scaffold generator produces?
I run:
> script/generate scaffold modelname controllername
And now I need to do some work inside the controllername.rb file. For
example, pulling a list from another database table to supply
2006 Jan 29
2
field sets and unicode
Hello gentlemen,
I''ve forced to such unicode problem:
I have:
<%= text_field_tag ''search'', nil, :id => ''search'', :size => 10 %>
<%= observe_field ''search'',
:url => {:controller =>
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 Feb 08
2
URL rewriting
Here is the scenario I am trying to achieve. Basically, I want to run
the action "show" from my controller, without adding the "show/id".
Standard:
http://www.domain.com/controllerName/show/id
I would like:
http://www.domain.com/controllerName/randomstring (where randomstring is
a
field in my model/table, that is equivalent to a GUID -> and unique).
I''m confused
2006 Jan 27
1
Search generator and non-latin characters
I installed search generator and it works nice with latin characters in query, but when I use cyrillic it just shows all entities from table. I suppose it shows all the table when nothing appropriate found also. So the question is how to tune it for cyrillic for example and how to ?
Thanks,
Mikhail
2006 Apr 20
4
Many to Many Category structure with itself
Basically, I''m trying to have a table called "categories" have a many to
many relationship with itself. But I also want each catagory to be able
to be "copied" into another category so it is essentially a child
category to more than one parent. To me the obvious way of doing this is
by creating another table called category_maps (and a model called
CategoryMap).
2006 Jan 25
2
how to define content charset?
I tried to define koi8-r charset in app/views/layouts/ like this:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<title>Cpu: <%= controller.action_name %></title>
<%= stylesheet_link_tag ''scaffold'' %>
</head>
But it doesn''t work. I suppose WEBrick already sent utf8 charset
2006 Feb 12
6
Including another helper
I need to include another helper module apart from the normal two
(ApplicationHelper and [controllername]Helper). The inclusion needs to
be dynamic and based on external parameters (ie what helper that get
included differ from request to request).
Is it possible? How?
/Marcus
2006 Feb 07
5
homepage instead of welcome page?
Got a noob question for ya...
When I visit http://localhost:3000/
I get the nice "Welcome to rails" page. To get to a controller I have to
go to:
http://localhost:3000/controllername
What if I don''t want the welcome message and want / to resolve to a
controller?
How do I set that up?
Thanks,
Dave
--
Posted via http://www.ruby-forum.com/.
2006 Jan 08
4
Rails table pluralizing Issue
Hi,
I am working on a table with name "addresses". However when I do a
ruby script/generate scaffold Address, I am not able to access
http://localhost:3000/addresses. I am getting the following error.
uninitialized constant Addres
This error occured while loading the following files:
addres.rb
How do I resolve this issue.
Thanks
Silvy MAthews
2006 May 02
1
Accessing Parameters - Params (nil)
I''m trying to render a component that pulls information based on a
parameter that is passed by a link_to item, but my params object is nil
for the following code in the controller:
records = ControllerName.find(params[:id])
but the error page also has this: Parameters: {"id"=>"7"}
I''ve tried to access it (in the controller) using:
variable =
2011 Sep 01
2
Removing special chars in strings?
Hi all,
How can I replace those "\" in the str?
Thanks in advance.
func <- function(str) {
print(gsub("\\","",str))
}
func("bla\ble\bli")
2006 May 28
1
Changing module name - help!
When I started developing my application I grouped my controllers in the
followin g fashion: User::ControllerName.
Now I''ve realized that the ''User'' module is a misnomer for my current
controllers and I need to use the User module for something else, so I
decided to change the controllers in the ''User'' module to ''Data''.
2006 Jan 18
7
Inspect
I am seeing a curious anomaly with the inspect method. It displays one
of the objects in a way I don''t understand. I''ll use the Recipes example
to illustrate.
First, I''ll describe the recipes table, then show how the @recipe
variable is being created in the controller and passed in to the show
view, and then show how I''m using the
2006 Feb 01
3
Testing components
I''m using template components to modularize an application I''m working
on and am really happy with the way it''s going. Unfortunately, all my
attempts at writing functional tests for them fail. Trying to duplicate
my normal controller tests I have:
require File.dirname(__FILE__) + ''/../test_helper''
require File.dirname(__FILE__) +
2006 Sep 07
5
url_for always escape string.
according to the documentation, only the url_for from ActionView escape
the
URL.
which happens on this line
escape ? html_escape(url) : url
and can be prevented by passing :escape =>
false to url_for.
still according to the documentation, the url_for from ActionController
is not supposed to escape the url.
BUT IT DOES.
at the moment of this line
escape ? html_escape(url) : url
url has
2006 Jan 17
4
textarea problem with accentued chars
Hello, I have a problem with accentued characters return from a textarea
I have 3 simple files to show example ( below ).
index.rhml : If I put "?nial" inside the textarea, then submit to
:action => post
post.rhml : wrote
?nial
195
"\303\251nial"
//
params[:comment][:message] return => ?nial
params[:comment][:message][1] return => 195 ! ( 195 is not
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 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 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