Sha256: 9a36f954bb666e01f4959534ce3ed4e810a22fb55a762abfd208a4904f27da14

Contents?: true

Size: 916 Bytes

Versions: 20

Compression:

Stored size: 916 Bytes

Contents

# Seed add you the ability to populate your db.
# We provide you a basic shell for interaction with the end user.
# So try some code like below:
# 
#   name = shell.ask("What's your name?")
#   shell.say name
# 
email     = shell.ask "Which email do you want use for loggin into admin?"
password  = shell.ask "Tell me the password to use:"

shell.say ""

account = Account.create(:email => email, :password => password, :password_confirmation => password, :role => "admin")

if account.valid?
  shell.say "Perfect! Your account was created."
  shell.say ""
  shell.say "Now you can start your server with padrino start and then login into /admin with:"
  shell.say "   email: #{email}"
  shell.say "   password: #{password}"
  shell.say ""
  shell.say "That's all!"
else
  shell.say "Sorry but some thing went worng!"
  shell.say ""
  account.errors.full_messages.each { |m| shell.say "   - #{m}" }
end

shell.say ""

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
padrino-admin-0.8.5 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.8.4 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.8.3 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.8.2 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.8.1 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.8.0 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.7.9 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.7.8 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.7.7 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.7.6 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.7.5 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.7.4 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.7.3 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.7.2 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.7.1 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.7.0 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.6.7 lib/padrino-admin/generators/templates/page/db/seeds.rb.tt
padrino-admin-0.6.3 lib/padrino-admin/generators/templates/db/seeds.rb.tt
padrino-admin-0.6.2 lib/padrino-admin/generators/templates/db/seeds.rb.tt
padrino-admin-0.6.1 lib/padrino-admin/generators/templates/db/seeds.rb.tt