Displaying 20 results from an estimated 10000 matches similar to: "Rails 1.2.2 link_to question"
2008 May 01
20
link_to meta programming question
I am trying to create a dynamic menu using the following construct:
<%- menu_list = [ ''first'', ''second'', ''third''] -%>
<ul>
<%- menu_list.each do |m| -%>
<%= link_to "List All #{m.titlecase.pluralize} <m>_path %>
<%- end -%>
</ul>
What I cannot determine is what I have to do to replace
2006 Feb 10
2
file column within link_to
Hi,
I correctly see:
image_tag url_for_file_column("element", "picture_url", "medium")
now I need to make it a link so I''ve used:
<%= link_to(image_tag url_for_file_column("element", "picture_url",
"medium"), {:controller => "products", :action => "sec_level",
:level_id => @element.id}) unless
2007 Feb 27
1
link_to :post true Newbie question
Hi All,
I am attempting to use a link_to helper to perform a form post using the
following construct:
<%= link_to ''Save'', {:action =>''create''}, :post => true %>
What I find is the parameters passed to the webserver are empty. My
model validation stuff triggers indicating the fields in question are
empty too. This is to create a new DB entry so no
2006 Jun 07
2
Hash flattening on paginator link_to
Hey
I need some help with pagination and the link_to in the view.
I''m trying to include a hash in the pagination link_to params and it
keeps flattening out my hash.
Example:
Here''s my hash called @answer:
"answer"=>{"6"=>"9bf31c7ff062936a96d3c8bd1f8f2ff3",
"7"=>"6f4922f45568161a8cdf4ad2299f6d23"}
2008 Jan 03
3
how to use "link_to" to deliver a parameter?
Hello, there:
I wish A link to invoke such a action together with the parameter
"zh_CN" "cookies/switch_language/zh_CH" to switch language
sellection, and I use the following code:
<%= link_to ''Chinese'', :controller => ''cookies'', :action =>
''switch_lang'' %>
But, how is "link_to" able to convey
2008 Oct 17
1
link_to + image_tag
i want to integrated link_to with image_tag
before i did link_to with image_tag like this
<%=link_to image_tag(image.filename
2006 May 24
1
link_to CSS problem
Hi all,
I''m a Ruby/Rails/web development newbie, so this may be a stupid
question. I''m putting some links using link_to into my rhtml page,
creating the layout using the DIV tag:
<div id="description">
<%= link_to h (item.description), :action => ''show'', :id => item.id
%>
</div>
...
div#description {
float: left;
2007 Dec 06
2
passing parameters through link_to
Is it possible to pass parameters through link_to that will be used by
the controller that link_to directs to? Specifically I have this
code:
<% for user in @users -%>
<%= link_to user.screen_name, {:action => "index", :controller =>
"users", :user_id => user.id } %>
<% end %>
Is it possible to use the parameter at the end of link_to(:user_id
2007 Nov 14
3
absolute urls in url_for vs. link_to
In both url_for and link_to, the :only_path param can be used to
determine whether the link url used is complete with hostname and path,
or just has the path (a kind of relative url).
However, in url_for it defaults to false (urls with hostnames), and in
link_to it defaults to true ( urls without hostnames, just paths).
Is there any reason for this discrepency? To me, it violates the
principle
2006 Jun 09
5
Using link_to with an image tag & link text
Hi ,
I was trying to use link_to along with image_tag
to setup a link that would open in an external window.
But I was unable to make a link using both text & an image
So my current workaround looks like this inside a partial
where link is http://foo.com & text would be descriptive
<img src="images/arrow.gif" border="0"/> <%= link_to(text, link,
:popup
2006 Jun 06
8
How do I wrap a <%= link to %> around an image?
I''ve got a bunch of dynamically generated link paths that I want to use
to link some dynamically-generated image paths. Specifically, I want to
link thumbnails in a gallery to the larger images.
But I''m stymied by Rails'' syntax. I can''t figure out how to do this.
I tried this:
<%= link_to(image_tag("../../images/photos/photo.photogroup/TN_
2006 May 11
3
can''t call link_to from within a model class
can anyone tell me how to call link_to from within a model class? I''m
trying to do something like the following:
validates_uniqueness_of :email, :message => "address has already
been taken. If you''ve forgotten your password, please click " +
link_to(''here'', :action => ''forgot_password'', :controller =>
2013 Mar 15
5
link_to should have its body and url arguments reversed
I think the link_to helper method is quite confusing with its arguments
order:
link_to body, url
link_to "Click me", @person
Why is it thay way round? I want to make a "link to [the] person", so I
would expect the order to be:
link_to @person, "Click me"
It reads much more natural. You don''t "link to [the] body", you "link to
2006 Jun 04
3
link_to tool tips
I think they are called tool tips...
I have view code that looks like this...
<%= link_to ''I'', :action => ''edit_innoculations'', :id => personnel %>
Is there an option (I don''t see it in api) to have tool tips for a
link_to ?
Craig
2006 Jun 20
4
Invoking MouseOver using link_to tag ?
Hi,
How can we trigger a JavaScript built in function from a <%= link_to %>
ie. i have the below statement in my view. I want to invoke a JavaScript
function on "MouseOver" of this below text (''TestingMouseOverEvents'').
<%= link_to "TestingMouseOverEvents" , :controller => "login", :action
=> "logout"%>
Note: The
2006 Apr 02
2
Custom built link_to display text problem
Hi,
I want to display the number of comments for a post in a link_to. So
the link will look like below.
Comments(3)
How do i build this string in the link_to. I get an error about trying
to convert a fixnum to a string see code below.
<% case post.comments.size
when 0 %>
<p>No Comments</p>
<% else %>
<P><%= link_to
2011 Jan 06
2
Link_to parameters
Hello,
I would like to have a link_to automatically populate a field in the
form that it is linking to.
For example (excuse my silly words, im trying to make a point)
<%= link_to "Add a COOL Post", new_post_path, :howcoolisit => ''COOL''
%>
<%= link_to "Add a NOTCOOL Post", new_post_path, :howcoolisit =>
''NOTCOOL'' %>
Then,
2006 May 26
2
link_to and fragment identifiers
Fragment identifiers, it took me 30 minutes just to figure out what
they are called.
I would like to be able to create url that looks like this:
post/view/id#comments
How do I do that with a link_to function?
link_to "Comments", :controller => "post", :action => "view", :id =>
post.id ???
Thanks guys! :-)
John Kopanas
http://www.kopanas.com
2006 Jan 25
3
Link_to within :flash
Is there any way to use a link_to method within a controller through a
:flash notice? If a user enters an incorrect username/password, I want
to have a link to a forgotten password form readily available.
My newbie attempt at doing this resulted in the following error:
undefined method `link_to'' for #<UserController:0x386aef8>
I suppose I could easily have a normal link, was
2005 Jul 16
2
Applying css style to a link_to
What is the proper syntax to apply a css class to a link created using
link_to?
I''ve tried
<%= link_to("details", :class => "details", :action => "edit", :id => event)
%>
but that creates a link which looks like
/admin/events/edit/3?class=details
which is not what I''m looking for.
Kyle Heon