Before marking this as duplicate. This answer didn't work for me:
Prevent user going back and viewing previously submitted form Rails
I want to prevent, that the user is able to go back to the payment form he submitted before.
What I am missing? This should be a easy task or not? What's my mistake?
This is some of the form:
<%= form_for :job, method: :post, url: {action: "create"} do |f| %>
<div class="infogroup">
<h5>Informationen zum Job</h5>
<p>Was für ein Job bieten Sie?</p>
</div>
<div class="form-group">
<%= label_tag(:jobtitle, "Jobtitel*") %>
<%= text_field_tag(:jobtitle) %>
</div>
<div class="form-group">
<%= label_tag(:jobtype, "Anstellungsgrad*") %>
<%= text_field_tag(:jobtype) %>
</div>
<div class="form-group">
<%= label_tag(:place, "Ort*") %>
<%= text_field_tag(:place) %>
</div>
[...]
This is the Controller code:
class JobsController < ApplicationController
require 'date'
def new
@job = Job.new
end
def create
@job = Job.new(article_params)
@job.save
redirect_to @job
end
private def article_params
d = Date.new();
d.strftime('%a %d %b %Y')
params.permit(:jobtitle, :jobdescription, :jobtype, :place, :company, :paid, :userid, d)
end
def show
@job = Job.where(id: params[:id])
end
end