Displaying 9 results from an estimated 9 matches for "picture_field".
2008 Jun 15
11
Ouch! Can't figure out this file upload issue...
Okay, so this is driving me crazy. I''m trying to do a file upload
using code from a book.
What happens:
I get wrong number of arguments (1 for 0) in the upload controller
save action. No idea why.
Schema:
The schema for the picture model object is just a textfield named
comments and a binary field called data.
Upload controller:
def get
@picture =Picture.new
end
def save
2005 Sep 07
0
model constructor errors.
...:local_path, :destroyed
attr_reader :original_filename
attr_accessible :title, :description
has_many :comments, :exclusively_dependent => true
belongs_to :user
validates_presence_of :title
validates_presence_of :description, :on => :update
acts_as_taggable
def picture=(picture_field)
logger.debug "in picture method" ## DEBUGGING
@local_path = picture_field.local_path
@filename = base_part_of(picture_field.original_filename)
@extension = @filename.split(''.'').pop
if @extension == "jpeg"
@extension = "jpg"...
2006 Apr 05
6
How to Upload Image through RoR??
...<%= file_field("store", "picture") %>
=======
Tha Actual fileld name of my Image field in Database is "store_photo"
with datatype LargeBLOB.
& Inside my Store Model I have specified "def picture" as follows:-
=========================
def picture=(picture_field)
self.store_photo = picture_field.read
end
=========================
Now When I am trying to Uplaod file by submitting form I am getting
error like:-
======================================
undefined method `read'' for "logo.gif":String
======================================...
2006 May 09
2
handling file upload onto local filesystem.
Hi,
I have a multipart form upload field uploaded through <%=
file_field("profile", "profile") %>
Once a submit happens, the action basically does something like:
profile = Profile.new(params["picture"])
This invokes the models = to method:
def picture=(picture_field)
...do a bunch of assignments here
end
def validate
... do a bunch of validations before saving
end
# do the actual file handling stuff here.
def after_save
end
My question is, is the after_save method the right place to put the File
manipulation stuff to copy and save the file on a directo...
2011 Nov 02
4
undefined method `updated_at' for #<Classified:0x686c5e4>
HEllo, I have the following problem with rails, I am new in this...is
there anyone who explain to me what´s happens?
Thanks
See below:
NoMethodError in Classified#show
Showing app/views/classified/show.rhtml where line #17 raised:
undefined method `updated_at'' for #<Classified:0x686c5e4>
Extracted source (around line #17):
14:
15: <strong>Date Posted:</strong>
2010 Sep 27
7
Uploading photos
Hi all,
Learning RoR (and loving it!) to develop a website. A requirement of the website is enabling users to upload photos to be made viewable (dynamically) on the website. Is this something I can develop with RoR?
Thanks,
Jeff
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2006 Mar 04
13
file_column
Restricting size of an uploaded file, is how is that possible? If I
do not want a user to upload a file larger than X bytes, can it
easily be done?
If I also would like restrict the types of files that can be
uploaded, how may I do so?
Thank you,
Sharkie
2006 Jan 11
8
Oracle and Rails seems really slow.... In development
I''m just looking into how to connect to Oracle using Rails. I''ve got
everything connecting and working as it should.
I have a Users table in Oracle:
create_table "users", :force => true do |t|
t.column "username", :string
t.column "created_on", :datetime
t.column "email", :string
t.column "note", :text
2006 Jan 05
40
RoR sucks, and heres why...
Well now that I got your attention....
Why RoR sucks:
1. It''s smarter than me. Just when I think I''ll have to do some mundane
thing (like I use to in PHP or ASP), I find out RoR does it already for
me.
2. It takes about half or less code to put my stuff together in RoR than
it did in PHP, ASP, ASP.NET, etc. It seems so unnatural that I can have
a method with only 4 lines