Skip to content

Instantly share code, notes, and snippets.

@tabishiqbal
tabishiqbal / _form.html.erb
Last active May 2, 2024 13:30
Ruby on Rails Tom-Select Example with Stimulus controller
<%= form_with(model: team) do |form| %>
<div>
<%= form.label :name %>
<%= form.text_field :name, class: "input" %>
</div>
<div>
<%= f.select :user_id, {}, {placeholder: "Select user"}, {class: "w-full", data: { controller: "select", select_url_value: users_path }} %>
</div>
@johnpaulashenfelter
johnpaulashenfelter / upgrade_homebrew_pg.sh
Created November 11, 2011 15:31
Upgrading homebrew postgres from 9.0.x to 9.1
Upgrading to homebrew postgresql 9.1.1 from 9.0.x
* Copy the old data
mv -R /usr/local/var/postgres/ /usr/local/var/postgres-901
* Create a new database using 9.1.1
/usr/local/Cellar/postgresql/9.1.1/bin/initdb /usr/local/var/postgres