similar to: Keeping format in link_to

Displaying 20 results from an estimated 20000 matches similar to: "Keeping format in link_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
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
2008 Apr 24
2
select_tag and link_to
Does ROR allow passing the chosen value from a drop down using select_tag into link_to ? Basically I want to do something like: <%= select_tag( "name", options_for_select(%w{John Doe Jane })) %> <%= link_to "Delete", { :controller => "myname", :action => "add", :id => name },
2006 Aug 01
2
restful controllers - howto nest with link_to?
Hi List, I''m trying to get my grip on the restful methods that are now part of edge rails. Making the first steps was impressive as well as easy because there are already great resources on the blogs of early adopters: http://www.ryandaigle.com/articles/2006/08/01/whats-new-in-edge-rails-simply-restful-support-and-how-to-use-itand
2007 May 15
8
is there any hidden command in link_to function?
hi, i want to know how to pass hiddend values in link_to. if anybody know please tell me. Thanks in addvane. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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
2008 Jan 18
8
link_to problem
hi @ all I create a new archiv.html.erb and a archiv method in the controller. Now, I would like to link from index.html.erb to archiv.html.erb. I tried to use <%= link_to ''archive'', archiv_xxx_path %> but it doesn''t run. It appears a error message "SyntaxError in xxx#index". Does anyone know, how I can enhance this problem? thanks a lot... -- Posted
2006 May 02
6
Is there a link_to ''external url''?
I''ve checked the Rails documentation but find no mention of link_to ''external url'' or equivalent. Does rails have a built in method to do this? thanks -Lindsay -- Posted via http://www.ruby-forum.com/.
2007 Sep 10
3
link_to file
Hi, This is probably the stupidest question that I''m ever going to ask, but how do I create a link to a file? To be more clear, I simply want to create a link to a file that I am storing in the /public directory, say file.pdf. So, I upload the file to /public/ and then I would like to be able to do something like, link_to( image_tag(''image.jpg''),
2008 Oct 31
6
link_to submit form value 2
Hi to all, I''d like to pass with a link to values inside some form. I''ve read in other posts that it''s possible if i include the forms inside a html <div>... So here it''s my code of the view : <div id="study"> <table> <tr><td><label for="study_titolo">Titolo di
2008 Apr 19
4
Displaying external url's
I am a rails beginner and I am having trouble displaying external urls on view. This is what i have in DB for ex: www.rubyonrails.com, if i try to construct the url on the page using link_to the url formed is - http://localhost:3000/www.rubyonrails.com. Can someone help me in fixing this issue. Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you
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 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 Feb 29
3
How to DRY REST admin path in URLs?
Hi everyone... For almost all of my objects I put a series of classic REST admin links in views. For example, for a ''user'', I have <%= link_to "Show", user_path(user) %> <%= link_to "Edit", edit_user_path(user) %> <%= link_to "Destroy", user_path(user), :confirm => "Are you sure", :method => :delete %> I am tired
2008 May 19
4
REST urls and Authenticity Token
Hi, I have a few questions regarding REST and the Authenticity Token. I''m using a RESTful aproach for my small project and everything worked fine untill I wanted to destroy a record. Lets say we have a listing of folder (a folder is just a record) and I want to destroy one by using this link: <%= link_to image_tag(''icons/folder_delete.png''), {:url =>
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
2009 Apr 29
7
problem with nil.user
Hi all, I''ve put new code into my app so that an administrator will have extra privileges (administer users, edit pages). The error is: ''Couldn''t find User without an ID'' So the app is looking for a logged in user when the homepage is accessed. Heres my code: site/index view: <% if is_logged_in? and logged_in_user.has_role?(''Moderator'')