Permalink
Browse files

Improvements :)

  • Loading branch information...
joost committed May 2, 2012
1 parent 5bd18b3 commit 32ffdb131ac249e3ccb57fa91ad5e229974bf0e7
View
@@ -34,9 +34,9 @@ To view the admin page go to /admin (username: admin, password: admin).
Create a scaffold for a model, for example:
- rails generate admin_scaffold post
- rails generate admin_scaffold post title:string body:text published:boolean
- rails generate admin_scaffold purchase order_id:integer amount:decimal
+ rails generate admin_interface:scaffold post
+ rails generate admin_interface:scaffold post title:string body:text published:boolean
+ rails generate admin_interface:scaffold purchase order_id:integer amount:decimal
This will:
* Create stuff similar to original Rails scaffold generator but for admin interface.
@@ -38,6 +38,12 @@ def l(time)
time.nil? ? '' : I18n.l(time)
end
+ # This is a replacement for Ransack's sort_link (https://github.com/ernie/ransack/blob/master/lib/ransack/helpers/form_helper.rb).
+ # It works for @search stuff and without @search stuff.
+ def order_link(ransack, attribute, options = {})
+ search ? sort_link(ransack, attribute, options) : attribute.to_s.humanize # FIXME: Model.human_attribute_name("title")
+ end
+
# Following are extra helper for kaminari gem (pagination).
# It shows similar to Redmine.
@@ -20,8 +20,8 @@ def index
private
- ADMIN_USERNAME = 'admin'
- ADMIN_PASSWORD = 'admin'
+ ADMIN_USERNAME = 'admin' # HTTP Basic admin username
+ ADMIN_PASSWORD = 'admin' # HTTP Basic admin password
def http_authentication
authenticate_or_request_with_http_basic do |username, password|

0 comments on commit 32ffdb1

Please sign in to comment.