Guest User

Untitled

a guest
May 29th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. class ProductsController < ApplicationController
  2. administrate_me do |a|
  3. f.combo :brand_id do
  4. Brand.all.map{|b| [b.name, b.id]}
  5. end
  6. # In case you have the to_select plugin installed you can do this
  7. f.combo :category_id do
  8. Category.to_select
  9. end
  10. # Also using a simple list of values
  11. f.combo :state do
  12. ['active', 'deleted']
  13. end
  14. end
Add Comment
Please, Sign In to add comment