Created
December 4, 2023 09:59
-
-
Save Zeko369/4d253f7651593663f228e1999818137d to your computer and use it in GitHub Desktop.
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 PostsController < ApplicationController | |
def index | |
end | |
def new | |
@post = Post.new(date: params[:date]) | |
end | |
private | |
def post_params | |
params.require(:post).permit(:title, :date) | |
end | |
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
<p style="color: green"><%= notice %></p> | |
<h1>Posts</h1> | |
<%= link_to "New post", new_post_path %> | |
<%= link_to "New post TODAY", new_post_path(date: Date.today) %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment