similar to: Quick Question: Using a CSS class statement in a link_to tag

Displaying 20 results from an estimated 10000 matches similar to: "Quick Question: Using a CSS class statement in a link_to tag"

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
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
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;
2006 Apr 17
3
Please help : how to link_to() and css styles ?
Hello, I''m having hard times on a very simple problem : how to provide a css class to a link_to tag ? I''m using this : <%= link_to ''Cancel'', :action => ''list'', :class => ''btn-cancel'' %> and RoR produces this : <a href="/gallery/list?class=btn-cancel">Cancel</a> I''ve read the doc
2006 Mar 01
15
Is there a perl equivalent of .= in ruby/rails??
I want to make a for loop that concats strings onto a variable: html .= var1 + "this is a test" + whatever What is the syntax that does this in ruby/rails? Also, is there a ''print'' method in ruby? Because when I try to use render_text it will only let me use this once. -- Posted via http://www.ruby-forum.com/.
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 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 Sep 04
2
how to? link_to with a rel="tag"
i want my html output to look like this: <a href="/path/to/page/" rel="tag">link text</a> how do i tell the link_to method that i need: rel="tag"? thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send
2006 May 28
2
"if" clause in the view - - - (for two objects)
Hi, sorry to bother you guys with a simple sytnax question; i have a loop of objects taking place (ie, for page in @pages....xxxxxxx....end) and a link associated to each pages so that in the end it looks like this: page1 (link) page2 (link) page3 (link) . . . page n (link) (all of this done by putting a simple ''link to'' in the for loop.) now i need to seperate two pages
2006 Jan 02
2
link_to : add title tag ?
How : <a href="/show/all">All</a> Could become : <a href="/show/all" title="Show All" >All</a> This is possible with the standdard link_to function ?
2006 Apr 01
3
Quick question about <% link_to something, :action => ...
Hi, I have a basic question. when i use <% link_to show_city, :action => ''my defined action'' :id => ''something'' %> //what is ID here? is this the parameter in my mysql db? basically how can i put a parameter into the link that when it hits my function, it can tell my function what to use as a condition to search. for example i have a table of
2006 Feb 21
4
customizing layouts for functions
I want to be able to have different layouts in my rails program for different functions. For example, when a person first comes to the site the layout will have a link that says ''home'', ''login'', or register on the menu bar. Once the user logs in however, the layout will change. I want it to show the links ''account manager'',
2009 Feb 24
7
Add .html extension by default
Hi all, i would like to add the .html extension by default to all my resources. What is the best way to do that? The reason for this is that i need to download the generated sites via wget and i need the .html extension for the downloaded files. Also it would be nice if the link_to would automatically generate the links with .html... Thanks, Gerold
2007 Jul 23
1
How to do link_to with query parameter AND css class
Folks, I''ve been trying to get a number of variations of the following line of template code to work: <%= link_to ''Show contact details'', :controller => ''people'', :action => ''show'', :class => ''actionLink'', :id => person %> I''ve tied putting curlies around the controller and action as well
2006 Feb 21
4
displaying double digits
Hi, I have a question about displaying digits in Rails. whenever I print the price of an item, if the last digit is a zero or double zeros then it doesn''t display properly. How do I display a number so that it looks like currency? thank you! -- Posted via http://www.ruby-forum.com/.
2006 Mar 31
3
Need to use a method without the layout
I need to use a method (called by one of my controllers) without using the layout. All the other methods in the controller need to use this layout except for thismethod (becausae it''s called by an Ajax script). I know how to use :layout=>layout_name when calling a method from another method, but nothing is calling this. The layout needs to be removed in the method itself or I need
2006 May 11
1
quick link_to question
Hey there, is there a way to include more variables besides the id as a hidden field (to not show in the url) when i''m using :post => true on a link_to() ? Thanks, Andr?s -- Andr?s Tarsoly tarsolya@gmail.com
2006 Apr 01
10
You have a nil object when you didn''t expect it!
Hi, I am creating a blog to learn ruby on rails. I have 2 different views/models/controllers, 1 called post and 1 called comments. How do i link a post from the views/post directory to the comments that belong to the post in the views/comment directory. This is the code in the post/show.rhtml <%= render :partial => "post", :object => @post %> <%= link_to
2005 Jul 17
0
RE: link_to and CSS
What you want is a.linkCommand:hover, etc -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Shelby Westman Sent: Monday, 18 July 2005 2:20 AM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails] link_to and CSS I am a bit confused about how
2007 Mar 28
5
link_to best practice
I''m looking for best practice for creating a hyperlink which has both an icon and text. I am currently using this in my view: <%= link_to image_tag(''icons/add.png'', { :align => ''absmiddle'', :border => 0, :size => ''16x16'', :alt => ''New education record'', :title => ''New education