Created
December 17, 2011 05:18
-
-
Save eclubb/1489315 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails generate migration add_image_id_to_blog_posts image_id:integer | |
rake db:migrate | |
Override the blog category model and add: | |
belongs_to :image | |
Override the blog category form and add an image picker to it: | |
<div class='field'> | |
<%= f.label :image -%> | |
<%= render :partial => "/shared/admin/image_picker", :locals => { | |
:f => f, | |
:field => :image_id, | |
:image => f.object.image, | |
:toggle_image_display => false | |
} %> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment