In my Business model, when I try to create a business and an error occurs, I noticed after the POST it gets rid of my shared/page_header partial:
def page_title
"#{@page_title}"
end
<% unless @page_title.blank? %>
<div class="row">
<div class="page-header span12">
<h1><%= @page_title %></h1>
</div>
</div>
<% end %>
def new
@business = Business.new
@page_title = "Add Business"
end
def create
@business = Business.new(params[:business])
if @business.save
redirect_to :back, :notice => "This Business was successfully added."
else
render :new, :notice => "It seems there was an error. Please try again."
end
end
Now I notice I start on /businesses/new but after the POST it goes to /businesses. Someone told me this was normal, but I never seen this type of behavior until now. If it helps, the new and create actions are the only ones in my Business resource. What can I do to get this working?