Skip to content

random quotes for your rails application. dose of wisdom for your app.

License

Notifications You must be signed in to change notification settings

nshntarora/rails-quoter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quoter

Install the gem by adding the following line to your Gemfile.

gem 'quoter'

Then all you have to do is add the following line on the page you want the quotes to appear.

<%= quote_something %> or for inline <%= quote_something(template: :inline) %>

It will return a random quote in the following HTML markup.

<div class="quoter">
	<div class="quote">
		If you’re offered a seat on a rocket ship, don’t ask what seat! Just get on.
	</div>
	<div class="quotee">
		Sheryl Sandberg
	</div>
</div>

That's it. Everytime the page reloads a random quote will appear.

I personally recommend adding the code to a partial so that the quote only loads the one time you open the page and not reload on a fetch. But, I guess you already knew that

Special thanks to signed0's gist from where I took the 102 quotes you'll find the quotesDB module.

If you'd like to contribute the next thing on my list is to use the Wikiquote API to serve quotes about any topic. Start with that.

About

random quotes for your rails application. dose of wisdom for your app.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published