0

My link is

= link_to '+++ Sync categories', "cats/sync", :remote=>true

And I need to apply some CSS for the part '+++'

It works when I do it like this, but I have a space between the '+++' part and the rest which doesn't redirect to the link.

%span#create_cat_arrow.arrow +++
= link_to 'Sync categories', "cats/sync", :remote=>true

How can I apply the CSS only for the '+++' part?

Thanks in advance.

Sammy
  • 885
  • 3
  • 13
  • 32

1 Answers1

1
= link_to "cats/sync", :remote=>true do
  %span.myclass '+++ '
  Sync categories

or if you want in line styles

= link_to "cats/sync", :remote=>true do
  %span{style: "color: #c0c0c0"} '+++ '
  Sync categories
Chris Barretto
  • 9,379
  • 3
  • 42
  • 45
  • Thanks for the reply. But I couldn't figure out how to pass a parameter to sycn with this style. Can u help me with this as well? Thanks in advance – Sammy Feb 13 '14 at 05:58
  • link_to("cats/sync?key=value", :remote => true) do..., or if you are using your path helpers as dictated by your routes, you should be able to use link_to(cats_sync_path(:my => parameter), :remote => true) do... – Chris Barretto Feb 13 '14 at 14:58