Hi guys,
I’m a newbie in ruby and I would just like to know how you set a value
for a field in a table where session[:user_id] matches user.user_id.
I am trying to do this from a submit form in the show.html.erb file
because that is where the other field value is set.
Help would be much appreciated…
Title: <%=h @post.title %>
Mood: <%=h @post.mood %>
Location: <%=h @post.location %>
Thoughts: <%=h @post.thoughts %>
Comments
-
<% @post.comments.each do |comment| %>
-
<%= h comment.comment %>
Posted on <%= comment.created_at.strftime("%B %d, %Y at %I:%M %p")%>
<% end %>
<% form_for(:comment, :url => post_comments_path(@post)) do |f| %>
Comment:
<%= f.text_area :comment %>
<%= link_to ‘Edit’, edit_post_path(@post) %> |
<%= link_to ‘Back’, posts_path %>