Links for poor developers - <a href>

I don’t enjoy getting involved in design much, mostly because of cross
browser issues / css.
Anyway, I’m needing a nice menu. Problem is , most of what is out there
uses standard html links -
And the css is coded around those elements.
Is there a way to use
with link_to . I know i can probably
just
define a class , but wonder if there is an easier
way.

Stuart


On Nov 16, 2006, at 8:29 PM, Dark A. wrote:

I don’t enjoy getting involved in design much, mostly because of
cross browser issues / css.
Anyway, I’m needing a nice menu. Problem is , most of what is out
there uses standard html links -
And the css is coded around those elements.
Is there a way to use
with link_to . I know i can
probably just define a class , but wonder if there is an easier
way.

link_to is simply a helper to generate standard HTML links () so any Javascript or CSS techniques you would use with
HTML can be used with the resulting code.

Have you tried using link_to in a template and looking at the HTML
that’s produced? (with the ‘view source’ option in your browser).

James.

On 11/16/06, James S. [email protected] wrote:

way.

link_to is simply a helper to generate standard HTML links () so any Javascript or CSS techniques you would use with
HTML can be used with the resulting code.

Have you tried using link_to in a template and looking at the HTML
that’s produced? (with the ‘view source’ option in your browser).

James.

I have, and know , it turns into a href, but it seems as if the styling
is
lost anyway.

Stuart


Hi –

On Thu, 16 Nov 2006, Dark A. wrote:

probably just define a class , but wonder if there is an easier

I have, and know , it turns into a href, but it seems as if the styling is
lost anyway.

Try this:

link_to “Link text”, { :controller => “c”, :action => “a” },
:class => “myclass”

You can see it described in several places if you google for: link_to
css class.

David


David A. Black | [email protected]
Author of “Ruby for Rails” [1] | Ruby/Rails training & consultancy [3]
DABlog (DAB’s Weblog) [2] | Co-director, Ruby Central, Inc. [4]
[1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com
[2] http://dablog.rubypal.com | [4] http://www.rubycentral.org

On Nov 16, 2006, at 9:00 PM, Dark A. wrote:

styling is lost anyway.
What is your full link_to call, and what’s the HTML you’re expecting
to be output?

James.