This repository was archived by the owner on Dec 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
How to create a form with Beyond Canvas styles
Unai Abrisketa edited this page Oct 29, 2020
·
3 revisions
First of all, you'll need to make your controller use some of the layouts provided by Beyond Canvas:
class UsersController < ApplicationController
layout 'beyond_canvas/public'
endWe recommend setting the
beyond_canvas/publiclayout for theApplicationControllerso all controllers inheriting fromApplicationControllerwill use the same layout.
Then you are able to use a html structure like the following to create your form:
<div class="card card--padding">
<%= form_for @user, builder: BeyondCanvas::FormBuilder do |f| %>
<h2 class="card__headline">Create your account</h2>
<%= f.email_field :email, label: 'Your email' %>
<%= f.password_field :password, label: 'Your password', hint: 'Must contain letters and numbers.' %>
<div class="form__actions--left">
<%= f.button 'Save', type: :submit, class: 'button__solid--primary' %>
</div>
<% end %>
</div>- Home
- Getting Started
- Configuration
-
Customization
- Rails
- CSS
- JavaScript
- Forms
- How-to articles