This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # form for books#create page | |
| <%= simple_form_for(@book, :html => { :multipart => true }) do |f| %> | |
| <%= f.error_notification %> | |
| <div class="inputs"> | |
| <%= f.file_field :jacket_cover %> | |
| <%= f.input :title %> | |
| <%= f.input :synopsis, :as => :ckeditor, :label => false, :input_html => { :ckeditor => { :toolbar => 'Full', :height => 400 } } %> | |
| <%= f.input :body, :as => :ckeditor, :label => false, :input_html => { :ckeditor => { :toolbar => 'Full', :height => 400 } } %> | |
| <%= f.input :age %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Book < ActiveRecord::Base | |
| has_attached_file :jacket_cover, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "/images/:style/missing.png" | |
| validates_attachment_content_type :jacket_cover, :content_type => /\Aimage\/.*\Z/ | |
| validates :jacket_cover, :title, :slug, :synopsis, :body, :age, :publisher, presence: true | |
| validates_uniqueness_of :title | |
| extend FriendlyId | |
| friendly_id :title, use: [:slugged, :finders] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Inside books/form | |
| <%= simple_form_for(@book, :remote => true, :authenticity_token => true, :html => { :multipart => true }) do |f| %> | |
| <%= f.error_notification %> | |
| <div class="inputs"> | |
| <%= f.file_field :jacket_cover %> | |
| <%= f.input :title %> | |
| <%= f.input :synopsis, :as => :ckeditor, :label => false, :input_html => { :ckeditor => { :toolbar => 'Full', :height => 400 } } %> | |
| <%= f.input :body, :as => :ckeditor, :label => false, :input_html => { :ckeditor => { :toolbar => 'Full', :height => 400 } } %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # form to add images to the gallery | |
| <%= f.simple_fields_for :gallery do |builder| %> | |
| <%= builder.input :name %> | |
| <%= render 'galleries/form', :f => builder %> | |
| <% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BooksController < ApplicationController | |
| def show | |
| @gallery = @book.gallery | |
| end | |
| def new | |
| @book = Book.new | |
| @author = Author.new | |
| @school = School.new | |
| @book.build_author |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="inputs nested-fields"> | |
| <%= f.input :school_name %> | |
| <%= f.input :address %> | |
| <%= link_to_remove_association '', f, :class => 'fa fa-minus' %> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div> | |
| <label for="sort-by">Sort by</label> | |
| <select id="sort-by"> | |
| <option value="manual">Featured</option> | |
| <option value="price-ascending">Price: Low to High</option> | |
| <option value="price-descending">Price: High to Low</option> | |
| <option value="title-ascending">A-Z</option> | |
| <option value="title-descending">Z-A</option> | |
| <option value="created-ascending">Oldest to Newest</option> | |
| <option value="created-descending">Newest to Oldest</option> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Started GET "/users/" for 127.0.0.1 at 2015-02-02 13:07:58 +0000 | |
| Processing by UsersController#index as JSON | |
| User Load (1.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 42 ORDER BY "users"."id" ASC LIMIT 1 | |
| DEPRECATION WARNING: Relation#all is deprecated. If you want to eager-load a relation, you can call #load (e.g. `Post.where(published: true).load`). If you want to get an array of records from a relation, you can call #to_a (e.g. `Post.where(published: true).to_a`). (called from index at /Freelance/Current Projects/Pop Up Hub Project/build/popup-hub/app/controllers/users_controller.rb:4) | |
| User Load (1.8ms) SELECT "users".* FROM "users" ORDER BY created_at DESC | |
| Rendered users/index.html.erb within layouts/application (2.9ms) | |
| Role Load (0.7ms) SELECT "roles".* FROM "roles" WHERE "roles"."id" = $1 ORDER BY "roles"."id" ASC LIMIT 1 [["id", 2]] | |
| Rendered partials/_admin_menu.html.erb (0.3ms) | |
| Rendered partials/_components.html.erb (1.5ms) | |
| Rendered partials/_footer.html.erb (0.2ms) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| // # Globbing | |
| // for performance reasons we're only matching one level down: | |
| // '<%= config.src %>/templates/pages/{,*/}*.hbs' | |
| // use this if you want to match all subfolders: | |
| // '<%= config.src %>/templates/pages/**/*.hbs' | |
| module.exports = function(grunt) { |