similar to: Link_to with anchor?

Displaying 20 results from an estimated 14000 matches similar to: "Link_to with anchor?"

2006 Nov 28
1
link_to and url_for in ActionMailer
I am new to ActionMailer and having a problem. I want to be able to send a notification e-mail when a new item is added to a list. Sending an e-mail to the right people on creation is working fine. However, I want to include in the e-mail a link to the application so that users can click on the link in the e-mail and immediately be taken to the show view for the new item. When I add a link_to
2006 Jan 18
5
redirect_to with an anchor, how ?
Hello, I try this : redirect_to :action => ''infos'' , :id => params[:id] , :show => "comments#a" i want this : .../infos/15?show=comments#a but I have this : .../infos/15?show=comments%23a Someone could tell me how generate an anchor link ? Thanks
2006 Jun 10
2
How can I link/anchor down the page with #anchor in urls?
I''m trying to expand on a blog tutorial and one thing I can''t figure out is how to use anchors within pages. For example say I have sections on a page with anchors like <a name=section1"</a> through <a name=section6"</a>. Using older non-rails methods I would construct urls that contains the pound symbol and anchor name in the url such as
2006 Jan 03
7
link_to an external url ?
Simple question. Is it possible to generate a link like <a href="http://www.google.com" target="_blank" >google</a> with the link_to function ? Thanks
2006 Apr 04
2
How to apply class from Stylesheet to "link_to" element???
Hi, This is the "img" class for anchor element inside my stylesheet. ===================== A.img:link { color: #ffffff; text-decoration: none; } A.img:visited { color: #ffffff; text-decoration: none; } ====================== I can easily apply this tag inside my html document as follows:- ======= < a href="goodbye.html" class="img"> ======= Now I want to
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
2007 Nov 19
3
link_to and GET parameters
Hi, I am trying to generate a link to external site with GET parameters ( in new window). I tried following code, but it does not produce any parameters. <%=link_to "Open New Page", "https://www.foo.com/page/", {:popup => true}, {:param1 => "value1", :param2 => "value2"}%> and <%=link_to "Open New Page",
2006 Jun 27
4
Use link_to in a controller?
Hello. I realize that link_to is a helper that generally only has use in a view file, but recently I have come across a situation where it would be useful in a controller. I am trying to create a flash[:notice] and I want to link to another page. Of course, I could hard code the HTML, but for the sake of consistency, I was wondering if there is a way to abstract it from within the 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 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
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
2007 Jan 02
2
link_to method throws a url_for error
This error seems pretty bizarre. I''m using ActionMailer and am using a template in app/views/welcome_mailer/join.rhtml which has this line: <%= link_to :controller => ''group'', :action => ''join'', :group => @group.id, :ic => @code.code %> The error is: undefined method `url_for'' for #<WelcomeMailer: 0x2aaaad4fb470>
2007 Apr 09
8
How do I use link_to with all the current options?
In one of my pages I want to create some URLs that go to the same page, but tack on an extra parameter (column sorting stuff). How do I do that? I''ve tried link_to "Title", :sort => "title" and that''s pretty close...it keeps the controller name, but it doesn''t include one of the parameters. I''m using nested routes, so the URL should
2006 Jan 12
1
adding a destination anchor in the link
hi, I would like to specify a destination anchor in the generated link with the link_to helper, so the navigator opens the document at the given point. it should look something like this: /blog/archive/2006/01/10/test-post.html#comments I tried it with the following code: <% link_to("comments", :controller => "blog", :action => "archive", :year
2009 Jul 07
10
link_to, how do you combine url options and html_options?
I have a link-to that I wish to look somewhat like this: link_to "link here", new_object_path, :method => :post, :confirm => ''Press OK'', #url options :class => "css_class", :id => "css_id" #html options In any case I can either get the url_for options to work or the html options to work, but
2006 Apr 24
2
link_to external link
I have searched through the api several times through and can''t seem to find this. <%= link_to ''Help'', {:url => ''https://www.example.com/page?AppServeHelp''}, {:target => "_new"} %> but this doesn''t work as it still prepends the current server/controller space on the url itself. How do I accomplish this? Thanks Craig
2005 Aug 08
1
url_for()/link_to() Broken under Webrick?
After successfully getting my "productized" sites into production, I decided it was time to get the development environment working (i.e. through "script/server --site=foo"). However, when I go to run a site under Webrick, I get two major errors: (0) Routes don''t seem to work properly, specifically the root-level route gets ignored. Instead,
2006 Jan 18
2
How do you get link_to to work correctly when using subdomains as account keys?
When using subdomains as account keys (as per this HowTo: http://wiki.rubyonrails.org/rails/pages/HowToUseSubdomainsAsAccountKeys), how can you get link_to to spit out the correct URL (i.e. account123.domain.com)? <%= link_to "My Account", { :action => "show", :id => "account123" } %> would generate "http://www.domain.com/show/account123" I
2008 Jul 08
4
Conditional "link_to" helper function - AYUDAME POR FAVOR
Hello, I need to write a function that will return a link only if the current user is the owner. Here is my code... 1. application_helper.rb 2. 3. def link_to_if_owned(owner_id, anchor_text, where_to_go) 4. if current_user.id == owner_id # current user is owner 5. "#{link_to anchor_text, where_to_go}" 6. else 7. anchor 8. end 9. end And
2005 Mar 10
4
:anchor won''t work in 0.10.1
Anyone else having problems with :anchor? Until 0.10.0 it was working fine but with this recent update it''s just not doing anything. Thanks, Pedro