Comments (4)
Here is my post.rb file:
class Post < ActiveRecord::Base
has_many :comments
belongs_to :user
validates_presence_of :title, :body
attr_accessible :title, :body, :timestamp
cattr_reader :per_page
@@per_page = 5
named_scope :latest, :order => 'created_at DESC', :limit => 20
papermill :thumbnail => {:width => 100, :height => 75} # catch-all for non-specified associations, will create assets/asset methods.
papermill :image_gallery, :class_name => ImageAsset, :images_only => true, :thumbnail => {:width => 75, :height => 100}
image_gallery association (set with define_method)
end
from papermill.
this is my form code:
<% form_for(@post) do |f| %>
<%= f.error_messages %>
<%= f.label :title %>
<%= f.text_field :title %>
<br />
<%= f.label :body %>
<br / >
<%= f.text_area :body, :cols => 75, :rows => 35, :class => "mceEditor" %>
<br /><br />
<%= f.label :image_gallery %><br />
<%= f.images_upload(:image_gallery) %><br /><br />
<%= f.label :post_image %><br />
<%= f.image_upload(:post_image) %><br /><br />
<%= f.submit 'Submit' %>
from papermill.
Hello,
I just tried, I found no problem with your code.
The only thing I can think of is your @post is an instance of Array (???) when it should be an ActiveRecord::Base object.
Please check your @post object.
You also obviously have a routing problem (the "Couldn't find Post with ID=edit" part)
Weird. Have you found a solution meanwhile?
from papermill.
Closed
from papermill.
Related Issues (16)
- Problems on windows... HOT 5
- Index name too long for MySQL HOT 5
- Multiple words model name HOT 1
- File permission issue HOT 2
- Getting exception: undefined method 'sort_papermill_path' HOT 1
- Getting (Can't convert true into String) HOT 1
- Getting exception only with PDF file HOT 1
- Thumb regeneration every time the page is requested HOT 4
- Uncaught exception: undefined method `has_attached_file' HOT 5
- Formtastic 0.9.10 & Rails 2.3.8 HOT 2
- Conflict with Facebox in DOM ID & Jquery Delete not working in form HOT 1
- Where can I specify allowed file types? HOT 2
- Any plans for a Rails 3 branch? HOT 1
- rails3 HOT 1
- Papermill depends on mime-types >= 1.16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from papermill.