Twitter rails bootstrap helper methods

I am using twitter-bootstrap-rails stone in my application. It seems to come with a number of helper methods that create, for example, edit and delete buttons in a thematic view:

 <%= link_to t('.destroy', :default => t("helpers.links.destroy")), cohort_path(cohort), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger' %> 

Where are these t () methods and helpers defined? How can I change them? For example, if I want to change the shortcut on the Destroy button to β€œDelete”, I can change above:

 <%= link_to t('.destroy', :default => "Delete"), cohort_path(cohort), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger' %> 

I would really like to change t("helpers.links.destroy") to display "Delete" instead of "Destroy" in all of my views. I can do it? Appreciate your help!

+4
source share
1 answer

All you have to do is add the following to your i18n Rails file (in the path "config / locales / en.yml"):

 <pre> en: helpers: links: back: "Back Page" destroy: "Delete" </pre> 

The t () method uses a Rails application for i18n.

+4
source

All Articles