Created
February 19, 2014 16:19
-
-
Save pcasaretto/9095442 to your computer and use it in GitHub Desktop.
This file contains 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
# /Users/pcasaretto/src/rdstation/app/controllers/blog/title_controller.rb | |
class Blog::TitleController < ApplicationController | |
def new | |
@noun = params[:termo] | |
end | |
def create | |
noun = params[:noun] | |
if(!noun.blank?) | |
title_list = Blog::Title.list(noun) | |
@titles = title_list.shuffle[0..6] | |
render :show | |
else | |
flash.now[:error] = "Insira um termo como, por exemplo, landing pages" | |
render :new | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment