Refactor various ruby files
* Insights based on brakeman report
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
- if model = Kernel.const_get(controller_path.classify) rescue nil
|
||||
- model = controller_path.classify.constantize rescue nil
|
||||
- if model
|
||||
- object = model.find_by(id: params[:id])
|
||||
- if model.try(:nested_resource?)
|
||||
- root_element = model.model_name.human(count: 2)
|
||||
|
@@ -4,4 +4,4 @@ li.nav-item.dropdown
|
||||
span.caret
|
||||
ul.dropdown-menu.p-0.mt-1 role='menu'
|
||||
- I18n.available_locales.sort_by { |locale| t("locales.#{locale}") }.each do |locale|
|
||||
li = link_to(t("locales.#{locale}"), url_for(params.permit!.merge(locale: locale)), 'data-turbolinks' => "false", class: 'dropdown-item')
|
||||
li = link_to(t("locales.#{locale}"), url_for(request.query_parameters.merge(locale: locale)), 'data-turbolinks' => "false", class: 'dropdown-item')
|
||||
|
Reference in New Issue
Block a user