File tree Expand file tree Collapse file tree
rwf-admin/src/controllers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,12 +62,13 @@ impl PageController for ModelController {
6262 let table_name = model. clone ( ) ;
6363 let rows = Pool :: pool ( )
6464 . with_connection ( |mut conn| async move {
65+ let offset = format ! ( " OFFSET {}" , ( page - 1 ) * 25 ) ;
6566 Row :: find_by_sql (
6667 format ! (
6768 "SELECT * FROM \" {}\" {}LIMIT 25{}" ,
6869 table_name. escape( ) ,
6970 order_by,
70- format! ( " OFFSET {}" , ( page - 1 ) * 25 ) ,
71+ offset
7172 ) ,
7273 & [ ] ,
7374 )
@@ -79,10 +80,10 @@ impl PageController for ModelController {
7980 for row in rows {
8081 data. push ( row. values ( ) ?) ;
8182 }
82-
83+ let title = format ! ( "{} | Rust Web Framework" , model ) ;
8384 render ! ( request,
8485 "templates/rwf_admin/model.html" ,
85- "title" => format! ( "{} | Rust Web Framework" , model ) ,
86+ "title" => title ,
8687 "table_name" => model,
8788 "columns" => columns,
8889 "rows" => data,
You can’t perform that action at this time.
0 commit comments