Truncate data in ActiveAdmin index page -


is possible truncate data displayed attribute in activeadmin index page? 1 of attributes contains lot of text makes layout of table on index page hard at.

i'm trying this...

activeadmin.register post   index       column :id       column :title       column :body |body|         truncate(body, omision: "...", length: 100)       end       column :author     end end 

but error method 'truncate' doesn't exist.

there no need hide column, can use helpers in activeadmin, here case user comments in ../admin/user/:id:

  activeadmin.register user     panel "coments"       table_for user.comments         column :id         column "comment" |comment|           truncate(comment.content, omision: "...", length: 100)         end         column "created at" |comment|           l comment.created_at, format: :long         end       end     end   end 

will result in:

"lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt..."

activeadmin.register post   index       column :id       column :title       column :body |post|         truncate(post.body, omision: "...", length: 100)       end       column :author     end end 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -