Commit 2b75b359f1018f331421f3d1e00ec128af646235
1 parent
be675479
Exists in
master
and in
29 other branches
Fix BscHelper usage of truncate
Showing
2 changed files
with
4 additions
and
3 deletions
Show diff stats
plugins/bsc/controllers/bsc_plugin_myprofile_controller.rb
| 1 | -include BscPlugin::BscHelper | |
| 2 | - | |
| 3 | 1 | class BscPluginMyprofileController < MyProfileController |
| 4 | 2 | |
| 3 | + include BscPlugin::BscHelper | |
| 4 | + | |
| 5 | 5 | def manage_associated_enterprises |
| 6 | 6 | @associated_enterprises = profile.enterprises |
| 7 | 7 | @pending_enterprises = profile.enterprise_requests.pending.map(&:enterprise) | ... | ... |
plugins/bsc/lib/bsc_plugin/bsc_helper.rb
| 1 | 1 | module BscPlugin::BscHelper |
| 2 | 2 | include ActionView::Helpers::FormTagHelper |
| 3 | + include ActionView::Helpers::TextHelper | |
| 3 | 4 | |
| 4 | 5 | def token_input_field_tag(name, element_id, search_action, options = {}, text_field_options = {}, html_options = {}) |
| 5 | 6 | options[:min_chars] ||= 3 |
| ... | ... | @@ -69,7 +70,7 @@ module BscPlugin::BscHelper |
| 69 | 70 | end |
| 70 | 71 | |
| 71 | 72 | def short_text(name, chars = 40) |
| 72 | - truncate name, chars, '...' | |
| 73 | + truncate name, :length => chars, :omission => '...' | |
| 73 | 74 | end |
| 74 | 75 | |
| 75 | 76 | end | ... | ... |