Skip to content

Instantly share code, notes, and snippets.

View rdelandesen's full-sized avatar
👨‍💻
Working on something new

Romain de Landesen rdelandesen

👨‍💻
Working on something new
  • Former CTO of credit.fr and neocredit.ch
  • Paris, France
View GitHub Profile
@lazaronixon
lazaronixon / _form.html.erb
Last active April 19, 2025 13:32
Hotwire Event-Driven Update Pattern
<%= form_with model: citizen, class: "card flex flex-col gap", data: { controller: "form" } do |form| %>
<div class="flex flex-col gap mb-2">
<div class="flex flex-col gap-half">
<% countries = Country.order(:name) %>
<%= label_tag :country_id, "Country", class: "text-sm font-medium leading-none" %>
<%= select_tag :country_id, options_from_collection_for_select(countries, :id, :name, citizen.country_id), include_blank: "Select one", class: "input", data: { action: "form#submit", form_submitter_param: "on_country_change" } %>
</div>
<div class="flex flex-col gap-half">
<% states = State.where(country_id: citizen.country_id).order(:name) %>
@rdelandesen
rdelandesen / prepare-commit-msg
Created May 27, 2017 19:34
Commit message with JIRA branch name
#!/bin/sh
#
# Prepend the branch name to the commit message
#
# Example
# # On branch BRA-1_homepage
# git commit -m "Responsive menu"
# # => [BRA-1] Responsive menu
#
# Add this file as [repo]/.git/hooks/prepare-commit-msg