CSC/ECE 517 Spring 2015/ch1b 22 SF: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<font size="6"><b>Simple Form</b></font><br>
<font size="6"><b>Simple Form</b></font><br>


'''Simple Form <ref>https://github.com/plataformatec/simple_form</ref>''' is a very useful gem which allows you to create forms for your Rails application. It also integrates very easily with [http://getbootstrap.com/ Bootstrap].
'''Simple Form <ref>https://github.com/plataformatec/simple_form</ref>'''is a Rails gem used for easily creating Rails forms.
.


The topic write up for this page can be found [https://docs.google.com/a/ncsu.edu/document/d/1Ay5OOUkcLMC-FH61fAm3cNvB3Uyk2hJ09vHnRgqwL-k/edit here].
The topic write up for this page can be found [https://docs.google.com/a/ncsu.edu/document/d/1Ay5OOUkcLMC-FH61fAm3cNvB3Uyk2hJ09vHnRgqwL-k/edit here].
Line 18: Line 17:
=== Background ===
=== Background ===


Rails forms made easy <br />'''Simple Form''' aims to be as flexible as possible while helping you with powerful components to create your forms . The basic goal of '''Simple Form''' is to not touch your way of defining the layout, letting you find the better design for your eyes. Most of the DSL was inherited from Formtastic.
Simple Form aims to be as flexible as possible while helping you with powerful components to create your forms . The basic goal of Simple Form is to not touch your way of defining the layout, letting you find the better design for your eyes. Most of the DSL was inherited from Formtastic.
 
<div class="md-section-divider"></div>
 
== Getting Start ==


<div class="md-section-divider"></div>
<div class="md-section-divider"></div>


== Getting Started ==
=== Installation ===
=== Installation ===


Line 50: Line 46:
=== Work with Bootstrap ===
=== Work with Bootstrap ===


Similar to [http://html5boilerplate.com H5BP] and [http://960.gs 960 Grid System], Bootstrap is a simple and very popular front-end framework.
Similar to '''H5BP<ref>http://html5boilerplate.com</ref>''' and '''Grid System 960<ref>http://960.gs</ref>''', Bootstrap is a simple and very popular front-end framework.


With the following code while installing Simple Form, you can integrate Simple Form to Bootstrap
With the following code while installing Simple Form, you can integrate Simple Form to Bootstrap
 
<code class="language-ruby"><pre>rails generate simple_form:install --bootstrap</pre></code>
<div class="md-section-divider"></div>
 
# <code class="language-ruby"><span class="pln">rails generate simple_form</span><span class="pun"><nowiki>:</nowiki></span><span class="pln">install </span><span class="pun">--</span><span class="pln">bootstrap</span></code>
   
   
You have to be sure that you added a copy of the [http://getbootstrap.com/ Bootstrap] assets on your application.
You have to be sure that you added a copy of the Bootstrap assets on your application.


For more information see the generator output, out example application code and the live example app.
For more information see the generator output, out example application code and the live example app.
<div class="md-section-divider"></div>


== References ==
== References ==
<references/>
# https://github.com/plataformatec/simple_form
# https://github.com/plataformatec/simple_form
# http://getbootstrap.com/
# http://getbootstrap.com/
# https://github.com/justinfrench/formtastic
# https://github.com/justinfrench/formtastic
#
#

Revision as of 21:56, 18 February 2015

Simple Form

Simple Form <ref>https://github.com/plataformatec/simple_form</ref>is a Rails gem used for easily creating Rails forms.

The topic write up for this page can be found here.

Simple Form

Simple form is a Rails gem used for easily creating Rails forms.

The topic write up for this page can be found here.

Introduction

Background

Simple Form aims to be as flexible as possible while helping you with powerful components to create your forms . The basic goal of Simple Form is to not touch your way of defining the layout, letting you find the better design for your eyes. Most of the DSL was inherited from Formtastic.

Getting Started

Installation

You can use the following code to install simple_form:

gem install simple_form

But I recommend you to use the following way:
Add the following code to your Gemfile:

gem 'simple_form'

And in your Rails application root directory, run the following command:

bundle install

Run the following code to generate the simple_form into your app:

rails generate simple_form install

Work with Bootstrap

Similar to H5BP<ref>http://html5boilerplate.com</ref> and Grid System 960<ref>http://960.gs</ref>, Bootstrap is a simple and very popular front-end framework.

With the following code while installing Simple Form, you can integrate Simple Form to Bootstrap

rails generate simple_form:install --bootstrap

You have to be sure that you added a copy of the Bootstrap assets on your application.

For more information see the generator output, out example application code and the live example app.

References

<references/>

  1. https://github.com/plataformatec/simple_form
  2. http://getbootstrap.com/
  3. https://github.com/justinfrench/formtastic