diff --git a/app/controllers/effin_quotes_controller.rb b/app/controllers/effin_quotes_controller.rb index 25bf3f0..0acac35 100644 --- a/app/controllers/effin_quotes_controller.rb +++ b/app/controllers/effin_quotes_controller.rb @@ -1,5 +1,5 @@ class EffinQuotesController < ApplicationController - before_action :authenticate_user!, except: :home + before_action :authenticate_user!, except: [:home, :status] def index @quotes = EffinQuote.all @@ -23,6 +23,10 @@ def show @count = EffinQuote.incomplete.count end + def status + @last_quotes = EffinLog.where(random: false).order(created_at: :desc).limit(12) + end + def incomplete @quotes = EffinQuote.incomplete @@ -49,5 +53,5 @@ def destroy def quote_params params.require(:effin_quote).permit(:contents) - end + end end diff --git a/app/models/effin_quote.rb b/app/models/effin_quote.rb index 64dedd9..be77cfb 100644 --- a/app/models/effin_quote.rb +++ b/app/models/effin_quote.rb @@ -17,6 +17,10 @@ def self.words words end + def self.everywords + complete.map(&:words).flatten + end + def words contents.split(" ") end diff --git a/app/views/effin_quotes/home.html.erb b/app/views/effin_quotes/home.html.erb index 9c91415..72b0b2b 100644 --- a/app/views/effin_quotes/home.html.erb +++ b/app/views/effin_quotes/home.html.erb @@ -12,10 +12,12 @@
Typing
/effin helpwill get you a short explanation. If you lack inspiration, just type
/effin wordsand some random words will be proposed. -
Thanks to Aaron Reynolds for creating Effin' Birds and allowing me to create this and to Joe for outstanding support.
- -Created by Martin - let me know if you find any problem
+Thanks to Aaron Reynolds for creating Effin' Birds and allowing me to create this and to Joe for outstanding support ◦ created by Martin - let me know if you find any problem ◦ current <%= link_to "status", "/status" %>
Lacking ideas? Here are some words from the birds:
-<%= image_tag("cloud.png") %> \ No newline at end of file +<%= image_tag("cloud.png") %> + ++(courtesy of https://www.wordclouds.com/) +
\ No newline at end of file diff --git a/app/views/effin_quotes/status.html.erb b/app/views/effin_quotes/status.html.erb new file mode 100644 index 0000000..56cee19 --- /dev/null +++ b/app/views/effin_quotes/status.html.erb @@ -0,0 +1,18 @@ +A Slack bot that allows you to answer to coworkers using supportive messages right from the effin' birds mouths
+ +