corn_starch 1.3.37 → 1.3.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/corn_starch/corn_starch_controller.rb +15 -1
- data/lib/corn_starch/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bb69ecc231b1f74856594915e730842ac078511
|
4
|
+
data.tar.gz: a31ca908402580a34e410115169d75c8f0a7cd21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0a476f5610561f88b6a08e2d11980f1eb4129808d8e358aeab81c9419efed9ebb9cc7c042949e1e3f477eba56fc5d9d260bbfc32ffee335169524727b1faeb0
|
7
|
+
data.tar.gz: 446bc8faa6acd154f1ebdc5311c176e165ee0138e9b089ddd0a565d79ff88ae829ae7709729e4365142fbf6928260b0b12183e05b3c415b6117043cf37a26616
|
@@ -11,7 +11,7 @@ module CornStarch
|
|
11
11
|
protect_from_forgery with: :exception
|
12
12
|
|
13
13
|
# Global Filters
|
14
|
-
before_filter :pagination_filter, :infiniscroll_filter
|
14
|
+
before_filter :pagination_filter, :infiniscroll_filter, :locale_filter
|
15
15
|
|
16
16
|
# Helper Methods
|
17
17
|
helper_method :user_model, :current_user, :is_authed, :is_self, :paginate, :notice_msg
|
@@ -82,6 +82,13 @@ module CornStarch
|
|
82
82
|
@infiniscroll[:params][:records_per_page] = params[:records_per_page] if params[:records_per_page]
|
83
83
|
end
|
84
84
|
|
85
|
+
# Locale Filter
|
86
|
+
def locale_filter
|
87
|
+
|
88
|
+
# Set Locale
|
89
|
+
I18n.locale = params[:locale] || I18n.default_locale
|
90
|
+
end
|
91
|
+
|
85
92
|
##################
|
86
93
|
# Helper Methods #
|
87
94
|
##################
|
@@ -112,6 +119,13 @@ module CornStarch
|
|
112
119
|
params[:id] == current_user.id.to_s
|
113
120
|
end
|
114
121
|
|
122
|
+
# Default URL Options
|
123
|
+
def default_url_options options = {}
|
124
|
+
|
125
|
+
# Include Locale in all generated URLs
|
126
|
+
{ locale: I18n.locale }.merge options
|
127
|
+
end
|
128
|
+
|
115
129
|
# Get Records
|
116
130
|
def get_records model, params
|
117
131
|
paginate unisearch(model, params[:search]), params
|
data/lib/corn_starch/version.rb
CHANGED