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
Rails Helpers
Unai Abrisketa edited this page Aug 18, 2021
·
6 revisions
Beyond Canvas offer various helpers that can be used within views.
Notifications will pop up in the upper right corner of your view. Depending on the use case, they can e.g. inform the user about a success or an error that occured.
More info
<%= notice_success 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', class: 'notice-text' %>
<%= notice_success class: 'notice-text' do %>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
<% end %>
More info
<%= notice_info 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', class: 'notice-text' %>
<%= notice_info class: 'notice-text' do %>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
<% end %>
More info
<%= notice_warning 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', class: 'notice-text' %>
<%= notice_warning class: 'notice-text' do %>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
<% end %>
More info
<%= notice_error 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', class: 'notice-text' %>
<%= notice_error class: 'notice-text' do %>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
<% end %>
The following helpers can be used as an indicator of the current status of e.g. products, orders, or processes.
More info
<%= status_good 'available', class: 'status-text' %>
<%= status_good class: 'status-text' do %>
available
<% end %>
More info
<%= status_warning 'low stock', class: 'status-text' %>
<%= status_warning class: 'status-text' do %>
low stock
<% end %>
More info
<%= status_danger 'out of stock', class: 'status-text' %>
<%= status_danger class: 'status-text' do %>
out of stock
<% end %>
More info
<%= status_neutral 'draft', class: 'status-text' %>
<%= status_neutral class: 'status-text' do %>
draft
<% end %>
More info
Uses inline_svg_tag
or image_tag
depending on the image format. It also adds class: 'logo'
and alt: 'logo'
attributes.
<%= logo_image_tag 'logo.svg' %>
<%= logo_image_tag 'logo.png' %>
More info
<%= step_list 'This is how to create a custom app:', [
{
headline: 'Test shop',
description: 'Get your free <href="https://signup.beyondshop.cloud/" class="link--primary">developer test shop</a>.'
},
{
headline: 'Custom app',
description: 'Add a custom app under Apps > Custom apps. Enter a name for your app. Select Save.'
}
] %>
- Home
- Getting Started
- Configuration
-
Customization
- Rails
- CSS
- JavaScript
- Forms
- How-to articles