diff --git a/Gemfile b/Gemfile index a8f356b..1a63529 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ git_source(:github) do |repo_name| end # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 5.0.6' +gem 'rails', '5.2.0.beta2' # Use Puma as the app server gem 'puma', '~> 3.0' # Use SCSS for stylesheets diff --git a/Gemfile.lock b/Gemfile.lock index 340c706..c304431 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/stympy/faker.git - revision: 56b19f27e7d0db07b74c7d94d0235492815cb760 + revision: 679fd508c9f41f41b6df62024d67bc2281953395 branch: master specs: faker (1.8.7) @@ -9,45 +9,48 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (5.0.6) - actionpack (= 5.0.6) - nio4r (>= 1.2, < 3.0) + actioncable (5.2.0.beta2) + actionpack (= 5.2.0.beta2) + nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.0.6) - actionpack (= 5.0.6) - actionview (= 5.0.6) - activejob (= 5.0.6) + actionmailer (5.2.0.beta2) + actionpack (= 5.2.0.beta2) + actionview (= 5.2.0.beta2) + activejob (= 5.2.0.beta2) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.0.6) - actionview (= 5.0.6) - activesupport (= 5.0.6) + actionpack (5.2.0.beta2) + actionview (= 5.2.0.beta2) + activesupport (= 5.2.0.beta2) rack (~> 2.0) - rack-test (~> 0.6.3) + rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.0.6) - activesupport (= 5.0.6) + actionview (5.2.0.beta2) + activesupport (= 5.2.0.beta2) builder (~> 3.1) - erubis (~> 2.7.0) + erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.0.6) - activesupport (= 5.0.6) + activejob (5.2.0.beta2) + activesupport (= 5.2.0.beta2) globalid (>= 0.3.6) - activemodel (5.0.6) - activesupport (= 5.0.6) - activerecord (5.0.6) - activemodel (= 5.0.6) - activesupport (= 5.0.6) - arel (~> 7.0) - activesupport (5.0.6) + activemodel (5.2.0.beta2) + activesupport (= 5.2.0.beta2) + activerecord (5.2.0.beta2) + activemodel (= 5.2.0.beta2) + activesupport (= 5.2.0.beta2) + arel (>= 9.0) + activestorage (5.2.0.beta2) + actionpack (= 5.2.0.beta2) + activerecord (= 5.2.0.beta2) + activesupport (5.2.0.beta2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) minitest (~> 5.1) tzinfo (~> 1.1) - arel (7.1.4) - autoprefixer-rails (7.2.3) + arel (9.0.0) + autoprefixer-rails (7.2.5) execjs axiom-types (0.1.1) descendants_tracker (~> 0.0.4) @@ -76,11 +79,11 @@ GEM coffee-script-source (1.12.2) concurrent-ruby (1.0.5) crass (1.0.3) - csv-importer (0.4.0) + csv-importer (0.5.0) virtus descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) - devise (4.3.0) + devise (4.4.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0, < 5.2) @@ -88,6 +91,7 @@ GEM warden (~> 1.2.3) diff-lcs (1.3) equalizer (0.0.11) + erubi (1.7.0) erubis (2.7.0) execjs (2.7.0) factory_bot (4.8.2) @@ -112,7 +116,7 @@ GEM haml (>= 4.0, < 6) nokogiri (>= 1.6.0) ruby_parser (~> 3.5) - i18n (0.9.1) + i18n (0.9.3) concurrent-ruby (~> 1.0) ice_nine (0.11.2) jbuilder (2.7.0) @@ -138,28 +142,29 @@ GEM mini_magick (4.8.0) mini_mime (1.0.0) mini_portile2 (2.3.0) - minitest (5.10.3) - multi_json (1.12.2) - nio4r (2.1.0) + minitest (5.11.1) + multi_json (1.13.1) + nio4r (2.2.0) nokogiri (1.8.1) mini_portile2 (~> 2.3.0) orm_adapter (0.5.0) - pg (0.21.0) - puma (3.11.0) + pg (1.0.0) + puma (3.11.2) rack (2.0.3) - rack-test (0.6.3) - rack (>= 1.0) - rails (5.0.6) - actioncable (= 5.0.6) - actionmailer (= 5.0.6) - actionpack (= 5.0.6) - actionview (= 5.0.6) - activejob (= 5.0.6) - activemodel (= 5.0.6) - activerecord (= 5.0.6) - activesupport (= 5.0.6) + rack-test (0.8.2) + rack (>= 1.0, < 3) + rails (5.2.0.beta2) + actioncable (= 5.2.0.beta2) + actionmailer (= 5.2.0.beta2) + actionpack (= 5.2.0.beta2) + actionview (= 5.2.0.beta2) + activejob (= 5.2.0.beta2) + activemodel (= 5.2.0.beta2) + activerecord (= 5.2.0.beta2) + activestorage (= 5.2.0.beta2) + activesupport (= 5.2.0.beta2) bundler (>= 1.3.0) - railties (= 5.0.6) + railties (= 5.2.0.beta2) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.2) actionpack (~> 5.x, >= 5.0.1) @@ -175,9 +180,9 @@ GEM rails_stdout_logging rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (5.0.6) - actionpack (= 5.0.6) - activesupport (= 5.0.6) + railties (5.2.0.beta2) + actionpack (= 5.2.0.beta2) + activesupport (= 5.2.0.beta2) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) @@ -188,7 +193,7 @@ GEM responders (2.4.0) actionpack (>= 4.2.0, < 5.3) railties (>= 4.2.0, < 5.3) - rspec-core (3.7.0) + rspec-core (3.7.1) rspec-support (~> 3.7.0) rspec-expectations (3.7.0) diff-lcs (>= 1.2.0, < 2.0) @@ -207,7 +212,7 @@ GEM rspec-support (3.7.0) ruby_parser (3.10.1) sexp_processor (~> 4.9) - sass (3.5.4) + sass (3.5.5) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) @@ -239,12 +244,12 @@ GEM thor (0.20.0) thread_safe (0.3.6) tilt (2.0.8) - turbolinks (5.0.1) - turbolinks-source (~> 5) - turbolinks-source (5.0.3) + turbolinks (5.1.0) + turbolinks-source (~> 5.1) + turbolinks-source (5.1.0) tzinfo (1.2.4) thread_safe (~> 0.1) - uglifier (4.0.2) + uglifier (4.1.4) execjs (>= 0.3.0, < 3) virtus (1.0.5) axiom-types (~> 0.1) @@ -281,7 +286,7 @@ DEPENDENCIES mini_magick (~> 4.3) pg puma (~> 3.0) - rails (~> 5.0.6) + rails (= 5.2.0.beta2) rails-controller-testing rails_12factor rspec-rails (~> 3.0) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f7c8924..237879c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,6 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception + before_action :configure_permitted_parameters, if: :devise_controller? def after_sign_in_path_for(resource_or_scope) # case resource @@ -16,4 +17,26 @@ def after_sign_in_path_for(resource_or_scope) def after_sign_out_path_for(resource_or_scope) root_path end + + protected + + def configure_permitted_parameters + devise_parameter_sanitizer.permit(:sign_up, keys: [ + :first_name, + :last_name, + :title, + :gender, + :city, + :state, + :country, + :personal_website, + :instagram_handle, + :twitter_handle, + :workshop, + :speaker, + :business, + :business_name, + :business_website, + ]) + end end diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb new file mode 100644 index 0000000..5a6ac95 --- /dev/null +++ b/app/controllers/registrations_controller.rb @@ -0,0 +1,23 @@ +class RegistrationsController < Devise::RegistrationsController + def new + super + end + + def edit + super + end + + def update + super + byebug + image.attach(params[:user][:image]) + end + + def create + super + end + + def destroy + super + end +end diff --git a/app/models/user.rb b/app/models/user.rb index ebbbd69..4527c47 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -6,9 +6,9 @@ class User < ApplicationRecord has_many :attendees has_many :events, through: :attendees - has_many :skills has_many :categories, through: :skills + has_one_attached :image def full_name "#{first_name} #{last_name}" diff --git a/app/views/attendees/_list.html.haml b/app/views/attendees/_list.html.haml index 54e01ca..3e552f2 100644 --- a/app/views/attendees/_list.html.haml +++ b/app/views/attendees/_list.html.haml @@ -10,6 +10,7 @@ %tbody - attendees.each do |attendee| %tr + %td= attendee.user.image %td= attendee.user %td= link_to 'Destroy', attendee, method: :delete, data: { confirm: 'Are you sure?' } diff --git a/app/views/attendees/show.html.haml b/app/views/attendees/show.html.haml index f1047f4..677d0e6 100644 --- a/app/views/attendees/show.html.haml +++ b/app/views/attendees/show.html.haml @@ -1,5 +1,7 @@ = link_to 'Back', :back += image_tag @attendee.image + %p %strong First Name: = @attendee.first_name diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index d7fdcf9..0bbea03 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -4,6 +4,7 @@ <%= f.error_notification %>
+ <%= f.file_field :image %> <%= f.input :email, required: true, autofocus: true %> <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 34b4279..efd66b8 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -4,6 +4,7 @@ <%= f.error_notification %>
+ <%= f.file_field :image %> <%= f.input :email, required: true, autofocus: true %> <%= f.input :password, required: true, hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length) %> <%= f.input :password_confirmation, required: true %> diff --git a/config/application.rb b/config/application.rb index cf1c68b..47e7de8 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,4 +1,5 @@ require_relative 'boot' +# require "active_storage/engine" require 'rails/all' diff --git a/config/initializers/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb index dd236b5..da640d9 100644 --- a/config/initializers/new_framework_defaults.rb +++ b/config/initializers/new_framework_defaults.rb @@ -4,7 +4,7 @@ # # Read the Guide for Upgrading Ruby on Rails for more info on each option. -Rails.application.config.action_controller.raise_on_unfiltered_parameters = true +# Rails.application.config.action_controller.raise_on_unfiltered_parameters = true # Enable per-form CSRF tokens. Previous versions had false. Rails.application.config.action_controller.per_form_csrf_tokens = true @@ -20,7 +20,7 @@ Rails.application.config.active_record.belongs_to_required_by_default = true # Do not halt callback chains when a callback returns false. Previous versions had true. -ActiveSupport.halt_callback_chains_on_return_false = false +# ActiveSupport.halt_callback_chains_on_return_false = true # Configure SSL options to enable HSTS with subdomains. Previous versions had false. Rails.application.config.ssl_options = { hsts: { subdomains: true } } diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb new file mode 100644 index 0000000..f306c19 --- /dev/null +++ b/config/initializers/simple_form.rb @@ -0,0 +1,169 @@ +# Use this setup block to configure all options available in SimpleForm. +SimpleForm.setup do |config| + # Wrappers are used by the form builder to generate a + # complete input. You can remove any component from the + # wrapper, change the order or even add your own to the + # stack. The options given below are used to wrap the + # whole input. + config.wrappers :default, class: :input, + hint_class: :field_with_hint, error_class: :field_with_errors do |b| + ## Extensions enabled by default + # Any of these extensions can be disabled for a + # given input by passing: `f.input EXTENSION_NAME => false`. + # You can make any of these extensions optional by + # renaming `b.use` to `b.optional`. + + # Determines whether to use HTML5 (:email, :url, ...) + # and required attributes + b.use :html5 + + # Calculates placeholders automatically from I18n + # You can also pass a string as f.input placeholder: "Placeholder" + b.use :placeholder + + ## Optional extensions + # They are disabled unless you pass `f.input EXTENSION_NAME => true` + # to the input. If so, they will retrieve the values from the model + # if any exists. If you want to enable any of those + # extensions by default, you can change `b.optional` to `b.use`. + + # Calculates maxlength from length validations for string inputs + # and/or database column lengths + b.optional :maxlength + + # Calculate minlength from length validations for string inputs + b.optional :minlength + + # Calculates pattern from format validations for string inputs + b.optional :pattern + + # Calculates min and max from length validations for numeric inputs + b.optional :min_max + + # Calculates readonly automatically from readonly attributes + b.optional :readonly + + ## Inputs + b.use :label_input + b.use :hint, wrap_with: { tag: :span, class: :hint } + b.use :error, wrap_with: { tag: :span, class: :error } + + ## full_messages_for + # If you want to display the full error message for the attribute, you can + # use the component :full_error, like: + # + # b.use :full_error, wrap_with: { tag: :span, class: :error } + end + + # The default wrapper to be used by the FormBuilder. + config.default_wrapper = :default + + # Define the way to render check boxes / radio buttons with labels. + # Defaults to :nested for bootstrap config. + # inline: input + label + # nested: label > input + config.boolean_style = :nested + + # Default class for buttons + config.button_class = 'btn' + + # Method used to tidy up errors. Specify any Rails Array method. + # :first lists the first message for each field. + # Use :to_sentence to list all errors for each field. + # config.error_method = :first + + # Default tag used for error notification helper. + config.error_notification_tag = :div + + # CSS class to add for error notification helper. + config.error_notification_class = 'error_notification' + + # ID to add for error notification helper. + # config.error_notification_id = nil + + # Series of attempts to detect a default label method for collection. + # config.collection_label_methods = [ :to_label, :name, :title, :to_s ] + + # Series of attempts to detect a default value method for collection. + # config.collection_value_methods = [ :id, :to_s ] + + # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none. + # config.collection_wrapper_tag = nil + + # You can define the class to use on all collection wrappers. Defaulting to none. + # config.collection_wrapper_class = nil + + # You can wrap each item in a collection of radio/check boxes with a tag, + # defaulting to :span. + # config.item_wrapper_tag = :span + + # You can define a class to use in all item wrappers. Defaulting to none. + # config.item_wrapper_class = nil + + # How the label text should be generated altogether with the required text. + # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" } + + # You can define the class to use on all labels. Default is nil. + # config.label_class = nil + + # You can define the default class to be used on forms. Can be overriden + # with `html: { :class }`. Defaulting to none. + # config.default_form_class = nil + + # You can define which elements should obtain additional classes + # config.generate_additional_classes_for = [:wrapper, :label, :input] + + # Whether attributes are required by default (or not). Default is true. + # config.required_by_default = true + + # Tell browsers whether to use the native HTML5 validations (novalidate form option). + # These validations are enabled in SimpleForm's internal config but disabled by default + # in this configuration, which is recommended due to some quirks from different browsers. + # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations, + # change this configuration to true. + config.browser_validations = false + + # Collection of methods to detect if a file type was given. + # config.file_methods = [ :mounted_as, :file?, :public_filename ] + + # Custom mappings for input types. This should be a hash containing a regexp + # to match as key, and the input type that will be used when the field name + # matches the regexp as value. + # config.input_mappings = { /count/ => :integer } + + # Custom wrappers for input types. This should be a hash containing an input + # type as key and the wrapper that will be used for all inputs with specified type. + # config.wrapper_mappings = { string: :prepend } + + # Namespaces where SimpleForm should look for custom input classes that + # override default inputs. + # config.custom_inputs_namespaces << "CustomInputs" + + # Default priority for time_zone inputs. + # config.time_zone_priority = nil + + # Default priority for country inputs. + # config.country_priority = nil + + # When false, do not use translations for labels. + # config.translate_labels = true + + # Automatically discover new inputs in Rails' autoload path. + # config.inputs_discovery = true + + # Cache SimpleForm inputs discovery + # config.cache_discovery = !Rails.env.development? + + # Default class for inputs + # config.input_class = nil + + # Define the default class of the input wrapper of the boolean input. + config.boolean_label_class = 'checkbox' + + # Defines if the default input wrapper class should be included in radio + # collection wrappers. + # config.include_default_input_wrapper_class = true + + # Defines which i18n scope will be used in Simple Form. + # config.i18n_scope = 'simple_form' +end diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml new file mode 100644 index 0000000..2374383 --- /dev/null +++ b/config/locales/simple_form.en.yml @@ -0,0 +1,31 @@ +en: + simple_form: + "yes": 'Yes' + "no": 'No' + required: + text: 'required' + mark: '*' + # You can uncomment the line below if you need to overwrite the whole required html. + # When using html, text and mark won't be used. + # html: '*' + error_notification: + default_message: "Please review the problems below:" + # Examples + # labels: + # defaults: + # password: 'Password' + # user: + # new: + # email: 'E-mail to sign in.' + # edit: + # email: 'E-mail.' + # hints: + # defaults: + # username: 'User name to sign in.' + # password: 'No special characters, please.' + # include_blanks: + # defaults: + # age: 'Rather not say' + # prompts: + # defaults: + # age: 'Select your age' diff --git a/config/routes.rb b/config/routes.rb index 1de63ba..946989d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,7 +4,7 @@ end resources :categories resources :skills - devise_for :users + devise_for :users, :controllers => {:registrations => "registrations"} get 'welcome/home' root 'welcome#home' diff --git a/db/migrate/20180125194432_create_active_storage_tables.active_storage.rb b/db/migrate/20180125194432_create_active_storage_tables.active_storage.rb new file mode 100644 index 0000000..360e0d1 --- /dev/null +++ b/db/migrate/20180125194432_create_active_storage_tables.active_storage.rb @@ -0,0 +1,26 @@ +# This migration comes from active_storage (originally 20170806125915) +class CreateActiveStorageTables < ActiveRecord::Migration[5.2] + def change + create_table :active_storage_blobs do |t| + t.string :key, null: false + t.string :filename, null: false + t.string :content_type + t.text :metadata + t.bigint :byte_size, null: false + t.string :checksum, null: false + t.datetime :created_at, null: false + + t.index [ :key ], unique: true + end + + create_table :active_storage_attachments do |t| + t.string :name, null: false + t.references :record, null: false, polymorphic: true, index: false + t.references :blob, null: false + + t.datetime :created_at, null: false + + t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 815b551..bf66759 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,11 +10,32 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171226224830) do +ActiveRecord::Schema.define(version: 2018_01_25_194432) do + + create_table "active_storage_attachments", force: :cascade do |t| + t.string "name", null: false + t.string "record_type", null: false + t.integer "record_id", null: false + t.integer "blob_id", null: false + t.datetime "created_at", null: false + t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" + t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true + end + + create_table "active_storage_blobs", force: :cascade do |t| + t.string "key", null: false + t.string "filename", null: false + t.string "content_type" + t.text "metadata" + t.bigint "byte_size", null: false + t.string "checksum", null: false + t.datetime "created_at", null: false + t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true + end create_table "attendees", force: :cascade do |t| - t.integer "user_id" - t.integer "event_id" + t.integer "user_id" + t.integer "event_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["event_id"], name: "index_attendees_on_event_id" @@ -22,62 +43,63 @@ end create_table "categories", force: :cascade do |t| - t.string "name" + t.string "name" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "events", force: :cascade do |t| - t.date "date" - t.string "theme" - t.string "venue_name" - t.string "state" - t.string "city" - t.string "country" - t.string "venue_contact_email" - t.string "venue_contact_name" - t.boolean "rent_again" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.date "date" + t.string "theme" + t.string "venue_name" + t.string "state" + t.string "city" + t.string "country" + t.string "venue_contact_email" + t.string "venue_contact_name" + t.boolean "rent_again" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "skills", force: :cascade do |t| - t.integer "user_id" - t.integer "category_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.integer "user_id" + t.integer "category_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["category_id"], name: "index_skills_on_category_id" t.index ["user_id"], name: "index_skills_on_user_id" end create_table "users", force: :cascade do |t| - t.string "email", default: "", null: false - t.string "encrypted_password", default: "", null: false - t.string "reset_password_token" + t.string "email", default: "", null: false + t.string "encrypted_password", default: "", null: false + t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" - t.integer "sign_in_count", default: 0, null: false + t.integer "sign_in_count", default: 0, null: false t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" - t.string "current_sign_in_ip" - t.string "last_sign_in_ip" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "first_name" - t.string "last_name" - t.string "title" - t.string "gender" - t.string "city" - t.string "state" - t.string "country" - t.string "personal_website" - t.string "instagram_handle" - t.string "twitter_handle" - t.boolean "workshop" - t.boolean "speaker" - t.boolean "business" - t.string "business_name" - t.string "business_website" + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "first_name" + t.string "last_name" + t.string "title" + t.string "gender" + t.string "city" + t.string "state" + t.string "country" + t.string "personal_website" + t.string "instagram_handle" + t.string "twitter_handle" + t.boolean "workshop" + t.boolean "speaker" + t.boolean "business" + t.string "business_name" + t.string "business_website" + t.string "avatar" t.index ["email"], name: "index_users_on_email", unique: true t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true end diff --git a/lib/templates/haml/scaffold/_form.html.haml b/lib/templates/haml/scaffold/_form.html.haml new file mode 100644 index 0000000..ac3aa7b --- /dev/null +++ b/lib/templates/haml/scaffold/_form.html.haml @@ -0,0 +1,10 @@ += simple_form_for(@<%= singular_table_name %>) do |f| + = f.error_notification + + .form-inputs + <%- attributes.each do |attribute| -%> + = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> + <%- end -%> + + .form-actions + = f.button :submit