2012-05-25 71 views
0

我使用最新的rails和twitter-bootstrap-rails,但我無法獲得我的輸入以顯示佔位符文本。當我添加以下內容:獲取帶引導程序的佔位符文本

@placeholderText: @grayLight 

要我bootstrap_and_overrides.css.less我得到一個都不能少::錯誤 有人能告訴我,我缺少的是什麼?

Syntax Error on line 30 
  (in /home/ubuntu/new-project/app/assets/stylesheets/bootstrap_and_overrides.css.less) 

更新** 的錯誤消失,現在由於xnm但我仍然沒有佔位符文本。 這裏是我的

@import "twitter/bootstrap/bootstrap"; 
body { padding-top: 60px; } 

@import "twitter/bootstrap/responsive"; 

// Set the correct sprite paths 
@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png'); 
@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png'); 

// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines) 
@fontAwesomeEotPath: asset-path('fontawesome-webfont.eot'); 
@fontAwesomeWoffPath: asset-path('fontawesome-webfont.woff'); 
@fontAwesomeTtfPath: asset-path('fontawesome-webfont.ttf'); 
@fontAwesomeSvgzPath: asset-path('fontawesome-webfont.svgz'); 
@fontAwesomeSvgPath: asset-path('fontawesome-webfont.svg'); 

// Font Awesome 
@import "fontawesome"; 

// Your custom LESS stylesheets goes here 
// 
// Since bootstrap was imported above you have access to its mixins which 
// you may use and inherit here 
// 
// If you'd like to override bootstrap's own variables, you can do so here as well 
// See http://twitter.github.com/bootstrap/less.html for their names and documentation 
// 
// Example: 
@linkColor: #ff0000; 
@placeholderText: @grayLight; 

,這裏是我的html:

<div class="placeholding-input"> 
    <input type="text" class="text-input" autocomplete="off" name="user[name]" maxlength="20"> 
    <span class="placeholder">Full name</span> 
</div> 

生成的樣式表只是不給我佔位符樣式。我想我應該@import一些東西,但我找不到任何信息。

+0

完整的錯誤將有所幫助。 'bootstrap_and_overrides.less.css'是一個錯字嗎?因爲如果沒有,那就是你的問題。 –

+0

是的,你是對的。錯誤修正和錯誤添加,但我不認爲這會有所幫助。 – pguardiario

回答

1

我發現了。顯然正確的方法是:

<input type="text" class="text-input" name="user[name]" maxlength="20" placeholder="Full name"> 

非常混亂,因爲我從twitter主頁複製了不正確的方式。

2

與sass不同,每行最後使用的分號較少。

@placeholderText: @grayLight; 
+0

謝謝,這讓錯誤消失了,但我仍然沒有獲得placehodler文本。請參閱上面的更新。 – pguardiario