Skip to content

Instantly share code, notes, and snippets.

@fenix011
Created April 15, 2014 16:54
Show Gist options
  • Save fenix011/10747205 to your computer and use it in GitHub Desktop.
Save fenix011/10747205 to your computer and use it in GitHub Desktop.
class ArticlesController < ApplicationController
def new
end
def create
@article = Article.new(article_params)
@article.save
redirect_to @article
end
private
def article_params
params.require(:article).permit(:title,:text)
end
def show
@article = Article.find(params[:id])
end
end
Blog::Application.routes.draw do
get 'welcome/index'
# The priority is based upon order of creation: first created -> h$
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
resources :articles
root 'welcome#index'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment