Skip to content

Instantly share code, notes, and snippets.

@Zeko369
Created December 4, 2023 09:59
Show Gist options
  • Save Zeko369/4d253f7651593663f228e1999818137d to your computer and use it in GitHub Desktop.
Save Zeko369/4d253f7651593663f228e1999818137d to your computer and use it in GitHub Desktop.
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
<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