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 Admin::ApplicationController < ApplicationController | |
| before_action :authorize_admin! | |
| def index | |
| @users = User.all | |
| @forums = Forum.all | |
| end | |
| private | |
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='page-header'> | |
| <h2>User - <%= @user.email %></h2><br> | |
| <p>Has been a user since <%= time_ago_in_words(@user.created_at) %> ago</p> | |
| <h4>Comments Made:</h4> | |
| <% @comments.each do |comment| %> | |
| <%= comment.text %> | |
| <% 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
| <blockquote class="comment"> | |
| <%= simple_format(comment.text) %> | |
| <footer> | |
| <%= time_ago_in_words(comment.created_at) %> ago | |
| by <cite><%= comment.author.email %></cite> | |
| </footer> | |
| </blockquote> |
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
| mfifth:~/workspace $ bundle exec rspec | |
| .......F | |
| Failures: | |
| 1) Users have functionality to delete their own topic's | |
| Failure/Error: click_link "Best Chinese Food" | |
| Capybara::ElementNotFound: | |
| Unable to find link "Best Chinese Food" |
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
| # SQLite version 3.x | |
| # gem install sqlite3 | |
| # | |
| # Ensure the SQLite 3 gem is defined in your Gemfile | |
| # gem 'sqlite3' | |
| # | |
| default: &default | |
| adapter: sqlite3 | |
| pool: 5 | |
| timeout: 5000 |
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
| mfifth:~/workspace $ bundle exec rspec | |
| /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize': could not connect to server: Connection refused (PG::ConnectionBad) | |
| Is the server running locally and accepting | |
| connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? | |
| from /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new' | |
| from /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `co nect' | |
| from /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize' | |
| from /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new' | |
| from /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.5/lib/acti |
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
| development: | |
| adapter: postgresql | |
| encoding: utf8 | |
| database: inventory_development | |
| host: localhost | |
| pool: 5 | |
| timeout: 5000 | |
| test: | |
| adapter: postgresql |
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
| <%= simple_form_for [@user, @message] do |f| %> | |
| <%= f.input :body %> | |
| <%= f.input :to, as: :string %> | |
| <%= f.input :from, as: :string %> | |
| <%= f.button :submit, class: "new btn-primary" %> | |
| <% 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 MessagesController < ApplicationController | |
| before_action :set_user | |
| def index | |
| @messages = @user.messages | |
| @message = Message.new | |
| end | |
| def create | |
| @message = Message.create(message_params) |
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
| <%= simple_form_for [@user, @message] do |f| %> | |
| <%= f.input :recipient %> | |
| <%= f.input :body %> | |
| <%= f.button :submit, class: "new btn-primary" %> | |
| <% end %> |