seyhunak / twitter-bootstrap-rails

Twitter Bootstrap for Rails 6.0, Rails 5 - Rails 4.x Asset Pipeline
https://github.com/seyhunak/twitter-bootstrap-rails
4.49k stars 996 forks source link

Fix themed generators simple form error span templating issue #849

Closed rubyrider closed 9 years ago

rubyrider commented 9 years ago

Bug for (components): Simple Form, HAML template, error_span helper Bug: Themed generators are generating the following template:

  = error_span(@example[:title])

What is missing to me: i.. There were no form object ii. By the above code it was actually passing the value of the attribute :title But the error_span helper method expects: i. form's object ii. object's attribute name References https://github.com/seyhunak/twitter-bootstrap-rails/blob/master/app/helpers/form_errors_helper.rb#15

How to produce:

My Fixes: Just made a change that the template of simple form and haml part to ensure:

  1. error_span is being called with form object
  2. attribute name is being passed to error_span helper

Now it seems all is working fine in my end. Thank you for such awesome gem.

seyhunak commented 9 years ago

@rubyrider can you please check travis build?

rubyrider commented 9 years ago

I can check, but I found those test cases were failing. and I already noticed about travis logs. So if you want I can push fixes to help passing travis for my own branches only. but travis might be keep failing master branch.

On Sun, Apr 12, 2015 at 11:41 PM, Seyhun Akyürek notifications@github.com wrote:

@rubyrider https://github.com/rubyrider can you please check travis build?

— Reply to this email directly or view it on GitHub https://github.com/seyhunak/twitter-bootstrap-rails/pull/849#issuecomment-92093918 .

Regards, Irfan Ahmed Rizvi, Freelancer- Senior Ruby on Rails Developer https://www.odesk.com/users/~01c44db951895e4589 m: +880 1766 67 81 30 e: irfandhk@gmail.com

ajitdsa commented 8 years ago

So just FYI, the fix made for this issue was only made to the HAML file, and not ERB or SLIM. I went ahead and forked the gem and added 1-line the fix in for those as well. It really should be there to be complete. Here is the forked repo:

https://github.com/ajitdsa/twitter-bootstrap-rails