Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
117 changes: 61 additions & 56 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: git://github.com/stympy/faker.git
revision: 56b19f27e7d0db07b74c7d94d0235492815cb760
revision: 679fd508c9f41f41b6df62024d67bc2281953395
branch: master
specs:
faker (1.8.7)
Expand All @@ -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)
Expand Down Expand Up @@ -76,18 +79,19 @@ 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)
responders
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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
23 changes: 23 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea if this is needed, just read something saying maybe?

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
23 changes: 23 additions & 0 deletions app/controllers/registrations_controller.rb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
1 change: 1 addition & 0 deletions app/views/attendees/_list.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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?' }

Expand Down
2 changes: 2 additions & 0 deletions app/views/attendees/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
= link_to 'Back', :back

= image_tag @attendee.image

%p
%strong First Name:
= @attendee.first_name
Expand Down
1 change: 1 addition & 0 deletions app/views/devise/registrations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<%= f.error_notification %>

<div class="form-inputs">
<%= f.file_field :image %>
<%= f.input :email, required: true, autofocus: true %>

<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
Expand Down
1 change: 1 addition & 0 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<%= f.error_notification %>

<div class="form-inputs">
<%= 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 %>
Expand Down
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require_relative 'boot'
# require "active_storage/engine"

require 'rails/all'

Expand Down
4 changes: 2 additions & 2 deletions config/initializers/new_framework_defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 } }
Loading