Boss Nass
Boss Nass

Reputation: 3522

SLIM add space at start of multi line

I am trying to add a space to the start of my slim template where I have had to break the text due to a link, I cant for the life of me work this one out

.mdl-cell.mdl-cell--4-col-phone.mdl-cell--8-col-tablet.mdl-cell--12-col-desktop
  | Don't have an account?
  = link_to 'Create one here.', sign_up_path

Upvotes: 7

Views: 9420

Answers (4)

Breno Perucchi
Breno Perucchi

Reputation: 893

with a simple quote ' the slim add a space

.mdl-cell.mdl-cell--4-col-phone.mdl-cell--8-col-tablet.mdl-cell--12-col-desktop
  | Don't have an account?
  '
  = link_to 'Create one here.', sign_up_path

Upvotes: 13

Michał Zalewski
Michał Zalewski

Reputation: 3368

You can use   to add space between html elements:

.mdl-cell.mdl-cell--4-col-phone.mdl-cell--8-col-tablet.mdl-cell--12-col-desktop
| Don't have an account? 
= link_to 'Create one here.', sign_up_path

Upvotes: 3

jeffdill2
jeffdill2

Reputation: 4114

If you have a space after | Don't have an account?, it will be honored. Perhaps your text editor is set to remove all trailing whitespace.

If that's the case, then the cleanest approach is to simply use | Don't have an account? .

Upvotes: 1

Boss Nass
Boss Nass

Reputation: 3522

found after some deeper research that the slim way is to use > so the new code is, which forced whitespace at the end of the first line

span> Don't have an account? 
= link_to 'Create one here.', sign_up_path

Upvotes: 20

Related Questions