Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>When:</strong></p> <p>On a bootstrapping phase. Someone has suggested seeds.rb. I personally prefer to use the <a href="http://github.com/sevenwire/bootstrapper" rel="nofollow noreferrer">bootstrapper</a> gem (with some addtions that allow me to parse csv files).</p> <p>This action allows you to create a rake task which can be invoked like this:</p> <pre><code>rake db:bootstrap </code></pre> <p>This will create the initial admin user, as well as any seeding data (such as the list of countries, or a default blog format, etc). The script is very flexible. You can make it ask for a password, or accept a password parameter, if you feel like it.</p> <p><strong>How:</strong></p> <p>In all cases I use <a href="http://wiki.github.com/stffn/declarative_authorization/" rel="nofollow noreferrer">declarative_authorization</a> in order to manage user permissions.</p> <p>Your admin user must return a role called 'admin' (or whatever name you choose) on the list of roles attached to it. I usually have 1 single role per user, mainly because I can use role inheritance (e.g. admins are also editors by default). This means that on my database I've got a single field for users called "role_id". 0 is usually for the admin role, since it is the first one created.</p> <p><strong>Where:</strong></p> <p>A specific file inside db/bootstrap/users.rb (or yaml, or csv) specifies the details of a user with the admin role activated. The <code>rake db:boostrap</code> order parses that file and creates the user accordingly.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload