Rails Admin modify list/show view to add new/customized column

3,587 views
Skip to first unread message

rahul garg

unread,
Apr 5, 2012, 3:45:59 PM4/5/12
to rails_admin
For list(&show) view of one of my Model , I want to show additional
column which would be a rendered html on the basis of values of
attributes of the instance of model.

How can I do that. Currenlty I have only found way to include partials
only for 'Edit'(,create,update) view only. But i have to render such
thing in list,show view.

--
Some code for reference and explanation:

My model registered in rails_admin:

config.model Utility do
list do
field :code
field :priority
field :name
field :url
field :phone
field :logo
field :content
sort_by :priority
items_per_page 100
end
end


This shows up following columns in rails_admin

Code | Priority | Name | Url | Phone | Logo | Content

what i want is:

Code | Priority | Preview

in which in Preview column i want to show a html rendering content
as :

<div class="blah">
<%=util.name%> <%=util.phone%> <%=util.logo%> .... #usage with
proper divs/tags/rendering
</div >

so that admin interface can properly view the data, as it is exactly
visible to users in one of the pages.

brunto

unread,
Apr 26, 2012, 4:03:27 PM4/26/12
to rails...@googlegroups.com
Hi,

Do you find a solution?
I'm looking to do smtg like that.

brunto

unread,
Apr 26, 2012, 5:09:11 PM4/26/12
to rails...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages