The controller for show has not been changed.   The parameters sent are:

Processing RecipesController#update (for 127.0.0.1 at 2010-11-20 06:41:23) [PUT]
Parameters: {"page_path"=>"recipes/show", "authenticity_token"=>"", 
"id"=>"3-giant-pickle", "recipe"=>{"tags"=>["", "@3", "@4"]}, "_"=>""}


In the meanwhile I wrote one in erb, like this:

                                <% form_for @recipe do %>
                                        <% for tag in Tag.find(:all) %>
                                                <% if tag.owner_is? 
current_user then %>
                                                        <%= check_box_tag 
"recipe[tag_ids][]", tag.id, @recipe.tags.include?(tag)  %>
                                                <%= tag.title %>
                                                <% end %>
                                        <% end %>
                                         <%= submit_tag 'Save' %>
                                <% end %>

It works, and its parameters sent are:

Processing RecipesController#update (for 127.0.0.1 at 2010-11-20 06:41:10) [PUT]
  Parameters: {"commit"=>"Save", "authenticity_token"=>"", 
"id"=>"3-giant-pickle", "recipe"=>{"tag_ids"=>["1", "3", "4"]}}


On Nov 19, 2010, at 4:06 PM, kevinpfromnm wrote:

> You already had it working with select-many right?  So it's got
> the :accessible => true for the tags association.
> 
> that particular part of the trace doesn't help much since it's all
> general code.  I'd be interested in the parameters sent with the call,
> any custom controller update (which it looks like that's not the
> case), and the relevant parts of the models.
> 
> On Nov 18, 8:59 pm, Mark Sobkowicz <[email protected]> wrote:
>> I am still working on the problem of users tagging recipes.   I could not 
>> use <select-many>, because <select-many> requires that the items being 
>> selected from have unique names, and I want users to make their own tags, so 
>> that some might indeed have the same name.   I want the users to tag recipes 
>> on the show-page, rather than the edit page, since only the owner of a 
>> recipe can edit the recipe.   So on the recipe show page I put:
>> 
>>                                 <form update="recipe">
>>                                         <check-many:tags/>
>>                                 <submit label="Update Tags"/>
>>                                 </form>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to