Displaying 20 results from an estimated 1047 matches for "link_to".
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 mo...
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&quo...
2007 Jun 28
23
DRYing link_to with a symbol
Hi, I just put in a patch that allows you to DRY up this:
<%= link_to @company.name, @company %>
to this:
<%= link_to :name, @company %>
The symbol indicates the method to be called on the object passed in
the link_to options.
http://dev.rubyonrails.org/ticket/8789
--~--~---------~--~----~------------~-------~--~----~
You received this message because...
2006 Aug 18
3
equivalent of "puts" in rhtml
Hi everyone,
This seems so basic, and yet I can''t quite figure it out.
Say I have some code in an .rhtml document:
<%=
if @session[:user_id]
link_to somethingA
else
link_to somethingB
link_to somethingC
end
-%>
Only the link to somethingC will show in the second case. I understand
that the last thing returned from that else block is that last line. In
php i could just add a ''print'' in front of both calls to link_to to...
2006 Jul 27
4
problem with elsif
...working with permissions, so if u are a
normal user, u can only view something and admins can view,edit, delete
i pick up the level, and then i check up, if the level is right, and
then i put the options. but i dont know why, the admin can only view and
delete, i mean my code only take the last link_to
here is the code:
<%= link_to "read", :action => "show", :id => message.send(''id'') %>
<%= if @level == 2
link_to "edit", :action => "edit", :id => message.send(''id'')
elsif @level == 3...
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...
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"=>"6...
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 the params: zh_CN as well?
seems like link_to doesn''t support a option :params =>
''zh_CN''.....
2006 Jan 22
6
Destructive behavior with link_to, button_to, :post=>true
...egular links. My typical way of doing this is to use "submit tags"
within forms. But these aren''t well suited for inline behavior since
you can''t nest forms and they also have problems since they are blocks.
So, what''s the "right" way to do this? link_to with the :post=>true?
button_to (not my favorite due to the nested form difficulty)
Jake
--
Posted via http://www.ruby-forum.com/.
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
,:size=>''110x85''),{:action=>''thumb_crop'',:controller=>''light'',:id=>image.id},:class=>''lightview'',:id=>image...
2006 Jan 11
5
stack level too deep problem
Hi all, I''m trying to overload the link_to function, (to disable link_to if
the user has no access right)
this is my code, it work the first time I run the application, the second
time I refresh the page I always get "stack level too deep error"
module UsersHelper
include ActionView::Helpers::UrlHelper
alias_method :link_to...
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 us...
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 Jul 07
5
link_to: link is missing id
I''m using a legacy table, where the unique id is not ''id''
I have a Model class like the following:
class Article < ActiveRecord::Base
set_primary_key "ARTICLE_ID"
end
however, using a link_to like the following (modified scaffolding),
the link has no id value:
<% for article in @articles %>
<tr>
<% for column in Article.content_columns %>
<td><%=h article.send(column.name) %></td>
<% end %>
<td><%= link_to ''Show&...
2005 Dec 15
6
passing parameters to link_to OR better way to do this?
...rhtml
======
<% @logs.each do |log| %>
<tr>
<td><%= log.base_name %></td>
<td><%= log.date_time %></td>
<td><%= log.status %></td>
<td><%= log.test_run_path %></td>
<td><%= link_to log.test_results_path, :action => "show_results",
:id => o, :params => { :result_file => log.test_results_path} %> </td>
</tr>
<% end %>
======
code:
====
def show_results
# get the results file and do some munging
end
Is there a way to pass...
2006 Jan 20
4
[newbie]how to use link_to to link to another controller?
I am just diving into Rails and I am a bit puzzled by the link_to function.
am writing an app to display my photographs in categories. My application layout
has a sidebar to show a menu with categories from the categories table in the
database (like in taken from the tutorials), to be shown on every page.
I managed to get a global @menu_categories object that k...
2011 Feb 20
6
Link_to frustration...help?
I have a resource ''users''. the index page has a ''link_to'' tag I
created on the line item level for a specific view. The link_to that
is frustrating me in particular says: <%= link_to ''View'', :controller
=> ''users'', :action => ''view'' %>
What''s happening is that it'&...
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;
width: 75%;
height: 20%;
}
If I put r...
2008 Jan 21
7
undefined method error
...re line #12 raised:
undefined method `new_entry_path'' for #<ActionView::Base:0x52fa56c>
Extracted source (around line #12):
9: <% if is_logged_in? %>
10: <li>Logged in as: <i><%= logged_in_user.username %></i></li>
11: <li><%= link_to ''My Profile'', edit_user_path(logged_in_user)
%></li>
12: <li><%= link_to ''New Blog Post'', new_entry_path(:user_id =>
logged_in_user) -%></li>
13: <li><%= link_to ''Upload Photo'', user_new_photo_path(...
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&qu...