Skip to content

Instantly share code, notes, and snippets.

<div class="font-mono text-xs whitespace-pre-wrap">form_state: <%= @form_state |> inspect(pretty: true) %></div>
<div class="font-mono text-xs whitespace-pre-wrap">saved_form_state: <%= @saved_form_state |> inspect(pretty: true) %> </div>
<div class="font-mono text-xs whitespace-pre-wrap">form_changeset: <%= @form_changeset |> inspect(pretty: true) %></div>
<div class="max-w-[300px] my-5">
<%= f = form_for(@form_changeset, "#", [ as: :form_data, phx_submit: :save, phx_change: :validate]) %>
<%= input f, :keyword, label: "Keyword" %>
<%= submit "save", class: "btn btn-outline text-sm mt-4" %>
@riverrun
riverrun / workout_form.ex
Created August 2, 2016 09:00
Json / map in Phoenix form
<%= form_for @changeset, @action, fn f -> %>
<%= if @changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<div class="form-group">
<%= label f, :type, class: "control-label" %>
<%= select f, :type, @workout_types, prompt: "Choose workout type", class: "form-control" %>
@cjonstrup
cjonstrup / Laravel\app\commands\ViewsCommand.php
Last active August 1, 2019 21:17
Clear Laravel 4.* app/storage/views artisan views:clear
<?php
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
class ViewsCommand extends Command {
/**
* The console command name.
*
* @var string
@kraftb
kraftb / gist:7246693
Created October 31, 2013 09:19
HOWTO: Use Fluid templates sharing a layout but use different content areas
TITLE: Classical TYPO3 advanced fluid templating
TAGS: TYPO3 FLUIDTEMPLATE templating cObject
template-start.html and template-page.html should get referenced from within the FLUIDTEMPLATE content object.
start.html and page.html are the files supplied by your designer.
It goes to and fro from template-start.html to start.html
Probably Neos is called "N"eos because of this fact.
-------------- template-start.html / BEGIN --------------------