Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

formula

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

formula

  • 2.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Formula

Formula is a Rails form helper that generates awesome markup. The project lets users create semantically beautiful forms without introducing too much syntax.

Requirements

The gem is tested with:

  • Ruby 3.3
  • Rails 7.2

Installation

gem install formula

Examples

<%= formula_form_for @user do |f| %>
  <%= f.input :email %>
  <%= f.input :password %>
  <%= f.button 'Save' %>
<% end %>
<%= formula_form_for @user do |f| %>
  <%= f.input :email, label: "Email:", hint: "We promise never to bother you." %>
  <%= f.input :password, label: "Password:", hint: "Must be at least six characters." %>
  <%= f.button 'Save' %>
<% end %>
<%= formula_form_for @company do |f|
  <%= f.input :url, container: { class: 'third' }, input: { class: 'fill' } %>
  <%= f.input :phone, container: { class: 'third' }, input: { class: 'fill' } %>
  <%= f.input :email, container: { class: 'third' }, input: { class: 'fill' } %>
  <%= f.button 'Save', button: { class: 'fancy' } %>
<% end %>
<%= formula_form_for @user do |f| %>
  <%= f.input :email, label: "Email:" %>
  <%= f.input :password, label: "Password:" %>
  <%= f.input :gender, label: 'Gender:', as: :select, choices: User::GENDERS %>
  <%= formula_fields_for @user.payment do |payment_f| %>
    <%= payment_f.input :credit_card_number, label: 'Number:' %>
    <%= payment_f.input :credit_card_expiration, label: 'Expiration:' %>
  <% end %>
  <%= f.button 'Save', button: { class: 'fancy' } %>
<% end %>
<%= formula_form_for @user do |f| %>
  <%= f.block :favourite %>
    <% @favourites.each do |favourite| %>
      ...
    <% end %>
  <% end %>
  <%= f.button 'Save', button: { class: 'fancy' } %>
<% end %>

Copyright (c) 2010 - 2024 Kevin Sylvestre. See LICENSE for details.

FAQs

Package last updated on 31 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc