I am trying to use a partial to customize my edit view in rails_admin. In config/initializers/rails_admin.rb I have:
RailsAdmin.config do |config|
config.model 'Album' do
edit do
field :promotion do
partial :hello_world
end
end
end
end
I have also tried the other syntax that can be found on the rails_admin wiki:
RailsAdmin.config do |config|
config.model 'Album' do
edit do
field :promotion do
def render
bindings[:view].render :partial => carrierwave.to_s, :locals => {:field => self, :form => bindings[:form]}
end
end
end
end
end
I am locating my partial at app/views/rails_admin/main/_hello_world.html.erb with the content:
<h1>Hello World!</h1>
After restarting my server nothing shows up in the edit view except for an empty 'promotion' field.
Rails_admin had a github issue for this. The discussion seemed inconclusive and the issue was closed before anyone confirmed that the solution worked for them. The issue can be viewed here:
https://github.com/sferik/rails_admin/issues/787
The moderator creates a spec for the issue and then closes it. The spec can be viewed at the very bottom of this file:
My concern with the spec is that it does not test where rails_admin looks for the partial. According to the rails_admin wiki partials should be location in app/views/rails_admin/main/
Please help me understand what I'm doing wrong or, at least, please assure me that rails_admin does not still have an issue here. I'm using Rails 4 and Ruby 2.0.0