rails ignoring news redirect_to
i've got unequivocally rudimentary rails doubt here nonetheless i can't seem answer anywhere. i speculation problems bend me following educational rails 1.2 rails 2.1. anyway..
i'm minute blog component i'm implementing comments bit. i have comments displaying glorious once i've combined controlling script/console, nonetheless removing critique form itself operative tough bit.
in posts_controller.rb i have
def comment
post.find(params[:id]).comments.create(params[:comment])
flash[:notice] = "added comment"
#render :action => show
redirect_to :action => show
finish
and show.html.erb (the view) i have
<%= form_tag :action => "comment", :id => @post %>
<%= text_area "comment", "body" %><br>
<%= submit_tag "post comment" %>
when i quarrel form tries urb /posts/comment/1 apparently incorrect, complains can't template. apparently i don't wish template there since i've told route arrangement movement since i wish only re-display post's arrangement page, new critique there.
i've attempted both commented out line (render :action => show) redirect_to line, conjunction seem anything during all.
i'm certain i'm blank something simple, nonetheless it?
Comments
Post a Comment