Sha256: 829363a1e1fe4b093dd094a0e3b6c79ae561346cfd36afadea56d17e78439eac

Contents?: true

Size: 1.71 KB

Versions: 6

Compression:

Stored size: 1.71 KB

Contents

*********************
Textile Editor Helper
*********************

The assets have been copied.


*********************
Example App
*********************

rails new something -d mysql
rake db:create RAILS_ENV=development
rails g scaffold Post body:text
rake db:migrate

*********************
Example layout
*********************

<!DOCTYPE html>
<html>
<head>
  <title>Peace</title>
  <%= stylesheet_link_tag    "application", :media => "all" %>

  <%= csrf_meta_tags %>
  <%= yield :head %>
</head>
<body>

<%= yield %>
<%= javascript_include_tag "application" %>
<%= yield :javascript %>
</body>
</html>


***************************
Example application.js
***************************

//= require jquery
//= require jquery_ujs
//= require textile-editor
//= require textile-editor-config

****************************
Example form
****************************

<%= form_for(@post) do |f| %>
  <% if @post.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2>

      <ul>
      <% @post.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :body %><br />
    <%= f.textile_editor :body %>
  </div>
  <div class="actions">
    <%= f.submit %>
    <% content_for :javascript do %>
    <%= textile_editor_initialize %>
    <% end %>
  </div>
<% end %>



********************************
Example: If you use simple_form
********************************

<%= simple_form_for @post do |f| %>
  <%= f.input :body, :as=>:textile_editor %>
  <%= f.button :submit %>

  <% content_for :javascript do %>
    <%= textile_editor_initialize %>
  <% end %>
<% end %>

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
textile_editor_helper-0.1.0 vendor/README
textile_rails-0.0.4 vendor/README
textile_rails-0.0.3 vendor/README
textile_rails-0.0.2 vendor/README
textile_editor_helper-0.0.31 vendor/README
textile_editor_helper-0.0.30 vendor/README