upmin / upmin-admin-ruby

Framework for creating powerful admin backends with minimal effort in Ruby on Rails.
MIT License
754 stars 66 forks source link

attribute.name and association.name partial paths #111

Closed fusepilot closed 10 years ago

fusepilot commented 10 years ago

This allows you to specify partial overrides based on attribute or association name for the whole system and not only on specific models.

I needed to customize an attribute's partial with a file_field input on more than one model. E.g.,

class Product < ActiveRecord::Base
  mount_uploader :image, ImageUploader
end

class Post < ActiveRecord::Base
  mount_uploader :image, ImageUploader
end

I can now add a partial to app/views/upmin/partials/attributes/_image.html.haml to override the attribute's partial for both models in Upmin.

mbrookes commented 10 years ago

Thanks Michael, would you mind documenting this in the wiki please? https://github.com/upmin/upmin-admin-ruby/wiki/Customizing-Views