similar to: relative links with link_to?

Displaying 20 results from an estimated 90000 matches similar to: "relative links with link_to?"

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
2008 Apr 07
0
link_to only links to current controller?
This is really confusing to me- I have some code in a page on the site I''m working on that works absolutely fine on one version of the code and totally doesn''t work on a newer version, in spite of the fact I can see no difference whatsoever either in the rhtml pages, the controller or any of the routing code. Right now I literally have no idea what the cause of this could be.
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
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 Apr 10
3
Link to local files
I have a small rails system I am building. Part of the code allow uploading files in to RailsRoot/public/files folder I am running this system is several places that have different domain and folder combinations. cases: 1) domain1.com/folder_a # where folder_a is a symbolic link from Apache document root to the public folder of rails app 2) domain2.com/folder_b/public # where folder_b is
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 keeps track of all the categories
2006 Jun 14
1
Absolute URL from link_to?
What options do I need to provide to link_to so that it generates truly absolute URLs (i.e. including protocol://host:port/path)? It seems that even when I provide :host and :protocol arguments to url_for that it suppresses these when they match the current request.
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
2011 Feb 12
5
link_to a action in the controlles is not called
i have a link where it has to call a method defin in todoscontroller named say_when but show is called <td><%= link_to ''Say when'', todo, :action => :say_when , :remote => true %></td> class TodosController < ApplicationController # GET /todos # GET /todos.xml def index @todos = Todo.all respond_to do |format| format.html #
2005 Dec 12
7
Calling absolute links
I have a primary layout that I''m using in several controllers. On my sidebar I have a link that I set up as follows: <div id="sidebar"> <%= link_to("Items", :action => "list") %> </div> Everything is ok when I call it from my primary controller, but since I am also calling the layout from a second controller that does
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
2006 Oct 06
0
link_to with :post => true causes "link hop" on submit
I have a link_to function that I''m calling with :post => true. When I click it, the link (which is in a table cell) moves up a bit and pushes the next table row down just a bit, like it''s hopping. My guess is that in the generated Javascript (by link_to), the addition of the form to the DOM is causing the link itself to move. Anyone seen this before, and if so, know a
2005 Nov 13
2
Link_to :protocol and :host?
Hello, I am trying to set the protocol and host in link_to based on the documentation. I have the following: <%= link_to "View Cart", {:controller => ''store'', :action => ''view_cart'', :protocol => ''https://'', :host => ''secure.host.com''} %> I would expect this to generate a https link to another
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 Mar 28
3
Brand newbie question relating to link_to
I recently dived into Rails and am having trouble with the link_to method. I''d like to pass some parameters to the action being called and am not sure how to do it. Essentially, I want to hyperlink a total count of bugs queried from the database to a method that will return the bug numbers when clicked on. I have a method, bug_total, that returns the total number to display in the
2005 Dec 15
6
passing parameters to link_to OR better way to do this?
Hi All: I''m writing my 1st Rails app and I can''t seem to find the answer on the web or in the book. I''m making a table, and I want to be able to expand a filename. The code is basically as as follows below. In the last <td> entry, I want to call an action and pass in the test_results_path, which I will go and read a file and munge the data for a separate
2013 Jun 05
1
Link_to image_tag popup
Hello All, How can I add a popup in link_to image_tag? I am trying as :- <%= link_to image_tag(@user.avatar.url(:small)), ''/users/edit'', :popup=>[''original_image'', ''height=700,width=900''] %> It goes to the edit page. But it doesn''t opens popup. Is this the correct way to call a popup? How can I achieve this? Thanks,
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''s going to
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",
2010 Apr 23
2
link_to with resource routes in helper file?
Hey all! Any pointers on doing something like: link_to "Comments", comments_path from within a helper file just like you can do from a view? Thanks in advance! -- 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