I have a table which stores information about sauces. Each sauce has an image inside the images assets folder, inside a folder called sauces. All sauces files are named the same;
eg assets/images/sauces/sauces_piri.png
All I want to do is basically upload a .png file in the form where the creation takes place, and inside the field of pic_url the name of the image is stored along with the sauces/ so it is directed correctly when I want to display the image.
Currently the administrator has to physically upload the image in the correct position using the domain file management, and also input the "sauces/sauces_name.png" when creating the new sauce.
The form for adding a new sauce :
<%= error_messages_for(@sauce) %>
<table summary="Sauces Form Fields">
<tr>
<th><%= f.label(:name,"Sauce Name") %></th>
<td><%= f.text_field(:name) %></td>
</tr>
<tr>
<th><%= f.label(:description, "Description") %></th>
<td><%= f.text_area(:description, :size => '40x5') %></td>
</tr>
<tr>
<th><%= f.label(:heat_level, "Heat Level") %></th>
<td><%= f.select(:heat_level,{ 1 => "1", 2 => "2", 3 => "3", 4 => "4", 5 => "5"}) %></td>
</tr>
<tr>
<th><%= f.label(:pic_url, "Picture URL") %></th>
<td><%= f.text_field(:pic_url) %></td>
</tr>
<tr>
<th><%= f.label(:title_colour, "Title Colour") %></th>
<td><%= f.text_field(:title_colour) %></td>
</tr>
<tr>
<th><%= f.label(:description_colour, "Desc Colour") %></th>
<td><%= f.text_field(:description_colour) %></td>
</tr>
</table>
So without using plug-ins such as paperclip how do I enable an image upload which then the file is stored in the correct place, and also in the table field pic_url the foldername/filename.png is stored?