Ecrire

$ psql -d postgres > CREATE USER <%= content_tag :span, user, class: %w(user) %> WITH PASSWORD '<%= content_tag :span, password, class: %w(password) %>'; > CREATE DATABASE <%= content_tag :span, database, class: %w(name) %>; > GRANT ALL PRIVILEGES ON DATABASE <%= content_tag :span, database, class: %w(name) %> to <%= content_tag :span, user, class: %w(user) %>; > \c <%= content_tag :span, database, class: %w(name) %> > CREATE EXTENSION IF NOT EXISTS hstore;
<%= form_tag onboarding_databases_path, method: :post do %> <% unless @exception.nil? %>
<%= content_tag :p, @exception %>
<% end %>

Connect to your postgresql database

<%= text_field_tag 'database[name]', database, placeholder: "Database name", class: %w(name) %> <%= text_field_tag 'database[user]', user, placeholder: "Database user", class: %w(user) %> <%= text_field_tag 'database[password]', password, placeholder: "Database password", class: %w(password) %> <%= button_tag 'Connect', value: 'connect' %> <% end %>