similar to: How to Upload Image through RoR??

Displaying 20 results from an estimated 2000 matches similar to: "How to Upload Image through RoR??"

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
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 Apr 05
3
how to insert Current DateTime value into database?
Hi, I want to insert onto database the Current DateTime Value into database field "Store_date" with datatype (DATETIME). How to do tihs? I am usiing hidden variable into my form as follows:- ======================= <%= hidden_field("store", "store_date", :value =>:datetime ) %> ======================= But when I m submmittng form I couldn''t find
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
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 Jun 08
5
How to find particular pattern in string?
Hi, In my application I want to find out the occurance of substring "http:\\" in the main string "http:\\www.abc.com" Here how to find out whether substring "http:\\" is present in my String? & if substring "http:\\" is present then I want to delete it from main string. How to do this? PLs help me. Thanx in advance. Prash -- Posted via
2006 Mar 17
3
How to check for presence of particular value entered ?
Hi, I am entering value in textbox ("name") on form. Now name field in database is having ''unique'' constraint on it so that no 2 records with same name allowed in database. Now when I m trying to enter same name into database from my form I m getting following error. ================================ Mysql::Error: #23000Duplicate entry ''Prashant''
2006 Mar 14
3
Can anybody tell me step by step how validate data on form?
Hi, I am new to ROR. I have created a form with foru fields in ROR. Now its working fine for all CRUD operations. But I want to validate data on form for "validates_presence_of" validation. How to do this? I tried it by putting line "validates_presence_of :description" . But its not working. Its throws error like "undefined method `each'' for
2006 Jun 06
4
pls help me regarding Maths round up function.....
Hi, I have some values on my webpage displaying like 1.22333333333 2.33333344444 2.33377777777 etc. Here I want to display values upto 2 decimal places correct. i.e, 1.22333333333 should be dislayed as 1.22 2.33333344444 should be dislayed as 2.33 2.33777777777 should be dislayed as 2.34 & so on.... How to do this in ruby????? Is there any function??? Thanx in advance. Prash --
2006 May 08
4
How to disable textbox in Ruby?
Hi, I want to disable textbox in my page so that user can not modify its contents. How can we do that in ruby? Thanx, Prash -- Posted via http://www.ruby-forum.com/.
2006 May 08
7
How to get difference between two dates in days???
Hi, I want to calculate difference between Current date & previous date (stored in database). The difference should be in days. Hhow to do that?? PLs tell me. Thanx in advance. Prash -- Posted via http://www.ruby-forum.com/.
2006 Mar 14
6
How to provide 2 actions to a form?
Hi, I have a form in rhtml. Now I have 2 buttons indside that form. Clicking on the first button action will be ''create'' & on second button action will be ''delete''. How to do this? Thanx Prash -- Posted via http://www.ruby-forum.com/.
2005 Sep 07
0
model constructor errors.
I have a model; I do photo = Photo.new(parameters) parameters contains: {"picture"=>#<File:C:/DOCUME~1/BART~1/LOCALS~1/Temp/CGI3180.1>} so i expect that the def picture=(filename) method is called in this constructor.. this is not the case. Does anyone know why? params[:photo].each_pair do |id, parameters| photo = Photo.new(parameters) end class Photo
2006 Mar 22
7
What is difference between render & redirect methods?
Hi, Thest are two methods:- 1) redirect_to :action => ''list'' 2) render :action => ''list'' what is difference between these two methods?????? Thanks. Prash -- Posted via http://www.ruby-forum.com/.
2006 May 01
4
Find rows with associations in habtm
This may have been asked/answered before - if so, i apologise... I have the following table layout in a habtm relationship: ------------ ----------------------- -------------- | products | ----| categories_products |-----| categories | ------------ ----------------------- -------------- What would be the best way to pull out all the products for a given category? At the
2006 Mar 17
2
How to specify default action for particulr actioncontroller
HI, How to specify default action for particular actioncontroller? Currently when I m typing the URL as "http:\\localhost:3000\actioncontroller_name" , then I m getting the default actin page as list.rHtml. But instead I want my action page to be index.rHtml. How to do it? Thanx. Prash -- Posted via http://www.ruby-forum.com/.
2006 May 09
3
How to transfer variables from one page to another page ?
Hi, In my application I want to tranfer a variable (store_id) from one page to next without putting it into session. How should I do this? Is there any way to transfer variable from one to other page using methods other than sesion? Thanx Prash -- Posted via http://www.ruby-forum.com/.
2006 Mar 22
2
What is wrong in this method??????
Hi, This is my definition of method "add_to_cart" ======================= def add_to_cart count=params[:product][:count] while count.to_i>=0.to_i if params[:product][''dem_quantity''+count.to_s]=="" else @product = Product.find(params[:product][''product_id''+count.to_s]) print @product.name
2006 Jun 09
2
How to mail decrypted password to user?
Hi, I am using acts_as_athenticated plugin for my rails application. That plugin is using "SHA1" algorithm to encrypt password & stroe it into database. Now in future suppose user requsted his password through email, hhow should I decrypt that password in my application & for sending it through mail? Please help me. I am trying this since last 2 days. But still not
2006 May 15
5
Login generator errors.
Okay, I download login generator and I used it on my new app but, it''s not working correctly. If the user logins on the same session as he created he will login if it isn''t the same session it fails. What''s going on? -- Posted via http://www.ruby-forum.com/.