Closed lingceng closed 9 years ago
Hey can you help us out and include a test for the helper here? See https://github.com/seyhunak/twitter-bootstrap-rails/issues/774
@toadkicker OK, I will fix #774.
When merge? B)
It needs test coverage before we merge it in
Sorry for late. @toadkicker I have added the test.
Thanks
When can update? B) P.S. Updated now, but no change
Make sure you use the master version as following:
gem 'twitter-bootstrap-rails' git:'https://github.com/seyhunak/twitter-bootstrap-rails.git'
And you may change the error_span usage as following:
f.error_span :title
I use just gem 'twitter-bootstrap-rails'
, without git
B)
gem 'twitter-bootstrap-rails' :git => 'https://github.com/seyhunak/twitter-bootstrap-rails.git', :branch => 'master'
OK
@toadkicker
Do you mean making error_span
an empty helper?
I did not find a way to make error_span(@foo[:attrib])
work as we wish.
I am update gem, and ...
ActionController::RoutingError (No route matches [GET] "/assets/fonts/fontawesome-webfont.woff")
@araslanov-e
Your problem discussed at #789
Try to config following in your bootstrap.css.less
to fix for now.
// Font Awesome
@import "fontawesome/font-awesome.less";
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
@fontAwesomeEotPath: font-url("fontawesome-webfont.eot");
@fontAwesomeEotPath_iefix: font-url("fontawesome-webfont.eot?#iefix");
@fontAwesomeWoffPath: font-url("fontawesome-webfont.woff");
@fontAwesomeTtfPath: font-url("fontawesome-webfont.ttf");
@fontAwesomeSvgPath: font-url("fontawesome-webfont.svg#fontawesomeregular");
@font-face {
font-family: 'FontAwesome';
src: @fontAwesomeEotPath;
src: @fontAwesomeEotPath_iefix format('embedded-opentype'),
@fontAwesomeWoffPath format('woff'),
@fontAwesomeTtfPath format('truetype'),
@fontAwesomeSvgPath format('svg');
font-weight: normal;
font-style: normal;
}
@lingceng because form_for accepts an array of objects the helper needs specificity of which object to observe. In you're test you're calling self which is in scope of the test, but in the context of the rails app it is lost. If there's a better way to get around self.object in the helper feel free to give it a try, but I'm fairly certain ruby wants it this way.
@lingceng thanks
I fixed this in railsstrap if you are interested, use it.
@toadkicker thanks, used railsstrap
@toadkicker +1
I am using the current master branch and the helper doesn't work
undefined local variable or method `object' for #<#Class:0x007fd2b87185a8:0x00000002e8b730> Extracted source (around line #16):
def errors_on?(attribute)
object.errors[attribute].present? if object.respond_to?(:errors)
end
@leckylao
Make sure your f.error_span(:hello)
in a form_for
tag, eg.
= form_for @card, html: { class: "form card" } do |f|
.form-group
= f.label :question, class: 'control-label'
= f.text_area :question, class: 'form-control rc-card-question', required: true, rows: '2'
= f.error_span(:question)
Note that, the demo code above is using haml
.
Thanks @lingceng. It made sense
It seems the old
error_span
helper does not work at all. I fix it by included in ActionView::Helpers::FormBuilder.