ruby on rails - Sort on 'first_name' instead of 'full-name' in Backgrid -


using backgrid, displaying users list. 'user' model having first_name , last_name attributes. have wrote method full_name on user model , displaying full name backgrid.

{   name: "full_name",   label: "name",   editable: false,   cell: 'string' } 

on server side using will_pagination. when clicks on full_name sort. gives error - "activerecord::statementinvalid (pg::undefinedcolumn: error: column "full_name" not exist".

so need sort on first_name instead of full_name. don't know how do? suggestions?

you sorting full_name make sortable first_name. don't use full_name in will_paginate , backgrid configurations.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -