diff --git a/README.md b/README.md index de92307b69..0524650736 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,6 @@ mount RailsAdmin::Engine => '/admin', :as => 'rails_admin' # Feel free to change ``` Note: The `devise_for` route must be placed before the mounted engine. The following will generate infinite redirects. -The following will generate infinite redirects. ```ruby mount RailsAdmin::Engine => '/admin', :as => 'rails_admin' diff --git a/app/views/rails_admin/main/_form_filtering_multiselect.html.haml b/app/views/rails_admin/main/_form_filtering_multiselect.html.haml index e352b913f6..fe74d55740 100644 --- a/app/views/rails_admin/main/_form_filtering_multiselect.html.haml +++ b/app/views/rails_admin/main/_form_filtering_multiselect.html.haml @@ -43,5 +43,5 @@ = form.select field.method_name, collection, { :selected => selected_ids, :object => form.object }, field.html_attributes.reverse_merge({:data => { :filteringmultiselect => true, :options => js_data.to_json }, :multiple => true}) - if authorized? :new, config.abstract_model - path_hash = { :model_name => config.abstract_model.to_param, :modal => true } - - path_hash.merge!({ :associations => { field.inverse_of => (form.object.id || 'new') } }) if field.inverse_of + - path_hash.merge!({ :associations => { field.inverse_of => (form.object.persisted? ? form.object.id : 'new') } }) if field.inverse_of = link_to " ".html_safe + wording_for(:link, :new, config.abstract_model), '#', :data => { :link => new_path(path_hash) }, :class => "create btn btn-info", :style => 'margin-left:10px' diff --git a/app/views/rails_admin/main/_form_filtering_select.html.haml b/app/views/rails_admin/main/_form_filtering_select.html.haml index 914f3975e3..a76c88abb6 100644 --- a/app/views/rails_admin/main/_form_filtering_select.html.haml +++ b/app/views/rails_admin/main/_form_filtering_select.html.haml @@ -30,7 +30,7 @@ - if authorized? :new, config.abstract_model - path_hash = { :model_name => config.abstract_model.to_param, :modal => true } - - path_hash.merge!({ :associations => { field.inverse_of => (form.object.id || 'new') } }) if field.inverse_of + - path_hash.merge!({ :associations => { field.inverse_of => (form.object.persisted? ? form.object.id : 'new') } }) if field.inverse_of = link_to " ".html_safe + wording_for(:link, :new, config.abstract_model), '#', :data => { :link => new_path(path_hash) }, :class => "btn btn-info create", :style => 'float:left; margin-left:10px' - if edit_url.present?