Permalink
Browse files

Renamed js widget to ransack_search_form, scoped I18n keys

  • Loading branch information...
1 parent 7e2808a commit 9d63da75076a916d8ab74c4e9161ddac8267dfdb @ndbroadbent committed Dec 18, 2012
@@ -1,5 +1,5 @@
(($) ->
- $.widget 'ransack.search_form',
+ $.widget 'ransack.ransack_search_form',
options: {}
_create: ->
@@ -1,6 +1,6 @@
.fields.condition{ "data-object-name" => f.object_name }
%p
- = link_to_remove_fields t(:remove_condition), f, options
+ = link_to_remove_fields t('ransack.remove_condition'), f, options
= f.attribute_fields do |a|
%span.fields{ "data-object-name" => f.object_name }
@@ -2,12 +2,12 @@
.combinator
- key = (f.object_name =~ /[0]/) ? :group_first : :group_rest
- combinator = f.combinator_select({}, :class => 'ransack_combinator')
- = t(key, :combinator => combinator).html_safe
+ = t("ransack.#{key}", :combinator => combinator).html_safe
.filters
- f.object.build_condition unless f.object.conditions.any?
= f.condition_fields do |c|
= render 'ransack_ui/condition_fields', :f => c, :options => options
%p
- = link_to_add_fields t(:add_condition), f, :condition, options
+ = link_to_add_fields t('ransack.add_condition'), f, :condition, options
@@ -11,7 +11,7 @@
= render 'ransack_ui/grouping_fields', :f => g, :options => options
%p
- = link_to_add_fields t(:add_group), f, :grouping, options
+ = link_to_add_fields t('ransack.add_group'), f, :grouping, options
%hr
@@ -22,4 +22,4 @@
.pull-right
= hidden_field_tag :distinct, '1'
= hidden_field_tag :page, '1'
- = f.submit t(:submit), :class => 'btn btn-primary btn-large'
+ = f.submit t('ransack.submit'), :class => 'btn btn-primary btn-large'
View
@@ -16,9 +16,9 @@ en:
gteq_any: "is after or on any"
gteq_all: "is after or on all"
- submit: Search
- add_group: Add a filter group
- group_first: "Show results where %{combinator} of the following match:"
- group_rest: "...and where %{combinator} of the following match:"
- add_condition: Add a filter
- remove_condition: Remove filter
+ submit: Search
+ add_group: Add a filter group
+ group_first: "Show results where %{combinator} of the following match:"
+ group_rest: "...and where %{combinator} of the following match:"
+ add_condition: Add a filter
+ remove_condition: Remove filter
@@ -1,6 +1,6 @@
module RansackUI
module ViewHelpers
- def ransack_ui_search(options)
+ def ransack_ui_search(options = {})
render 'ransack_ui/search', :options => options
end

0 comments on commit 9d63da7

Please sign in to comment.