Rails Render Problem

software development

#1

I just setup a new Rails application on my site. Almost everything is working, the only problem is that when I try to add a new item into my database, the form is not being rendered. For example, if you go to http://comic.marktopia.net/series, you will see a comic book series listed. If you try to create a new series or edit that series, you only get

The code for the new.rhtml is:

New series

<% form_tag :action => ‘create’ do %>
<%= render :partial => ‘form’ %>
<%= submit_tag “Create” %>
<% end %>

<%= link_to ‘Series List’, :action => ‘list’ %> || <%= link_to ‘New book’,:controller => ‘books’, :action => ‘new’ %>

and the code for _form.rhtml in the same folder is:

<%= error_messages_for ‘series’ %>

!–[form:series]–>

Name
<%= text_field 'series', 'name' %>

Volume
<%= text_field 'series', 'volume' %>

Year
<%= text_field 'series', 'year' %>

!--[eoform:series]-->

NOTE: I removed the < in front of the [eoform:series] lines so I could post them here.

I am open to suggestions or help. I have gone through the wiki entry for RoR for Dreamhost and could not find anything similiar to this. It also does not appear to be a DB connection problem since it is able to find items in the DB. Any advice or things to try would be great.


#2

just to be sure, you are actually doing a render_partial in new.rhtml, right?


Jonathan
http://fleshy.org.nz/yum/


#3

This is what I am calling in new.rhtml:

<% form_tag :action => ‘create’ do %>
<%= render :partial => ‘form’ %>
<%= submit_tag “Create” %>
<% end %>

I believe the second line there should be calling the form. Also, when I look at the source of new.rhtml, there is no form tag even.


#4

The form_tag syntax you are using is not available in all versions of Rails. This is not always clear when following online examples.

We are using explicit start/end form tags in our DreamHost Rails environment without issue. Try something like the following:

<%= start_form_tag :action => ‘create’ %>
<%= render :partial => ‘form’ %>
<%= submit_tag “Create” %>
<%= end_form_tag %>

Hope this helps,
Aron