[Rails] Re: How to create Categories in Rails
Hello Robert :)
No no, i need a clear category table. Here's what i done
I generated a migration
class AddCategoriesToPins < ActiveRecord::Migration
def change
add_column :pins, :category, :string
end
end
in my Pin Uploading form i added
<%= f.select :category, [ 'Box', 'Cover', 'Poster' ], :prompt => 'Select
One' %>
Now, the Selecting a Category when uploading Works, and the category
shows up properly in the Database.
But i want the user to click on that category in the Show Page and see
all the pin's that are in that category.
P.S.: Is this method even a good one ? I dont want the user's to be able
to create, edit, or delete a Category. Just selecting it.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7f3f769d661bad459f8186da6372740c%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home