Displaying 20 results from an estimated 700 matches similar to: "Upload an image"
2006 Apr 13
8
Controller paths
Hi there.
Suppose I create some controllers like
ruby script/generate controller Admin::product add remove
ruby script/generate controller Admin::user add remove
ruby script/generate controller Login login logout
the directory structure will be
app/controllers/admin/product_controller.rb
app/controllers/admin/user_controller.rb
app/controllers/login_controller.rb
Now suppose I need some links
2006 May 23
4
Protecting the source code.
Hello guys.
I need an opinion here. I need to make a mid-big size web project. Will
be a project that my boss wants to sell, and he don''t think show the
source code is a good idea and me neither, I love free software but on
this case will be a software made for a company who wants to try to make
some money with it.
My question is: PHP have things like Zend Guard
2009 Oct 03
1
NTLM
Hey there!
Can you guys tell me about what's the status of docs of NTLM/NTLMv2
provided by Microsoft?
Let me explain why I need that: we had here a discussion on a local
college about "free x proprietary software", and the Microsoft guy
(always them, right?) told us about a case where he claimed that
Firefox sent one user username and password through the network
without
2006 Jun 01
2
Union all
Hi there.
I have two models (and two tables, of course), let''s call them Room and
Reserved, with similar fields but with the last one with some extra
info, and need to get data from both using a "union all". Let''s think on
a hotel where I need to "glue" data to take a snapshot from the
occupation like:
Room (number,date,ocupied_by)
2008 Jul 14
1
about string error for upload file in rails 2.1
hello:
I have code for upload image file to server file system.This works
in rails
1.2.3.But in rails 2.1,it gets an error.
The following is the important code:
In a view:
<%form_for :user,:url=>{:action=>"register"},:html=>{:multipart=>true}
do |f|-%>
<p>
<label>照片</label>
<%=f.file_field "file"-%>
</p>
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 Apr 03
4
Multiple file uploads - only one file object gets posted
All,
Trying to upload multiple files.
Form:
<% index = 0
for @image in images do %>
<TR>
<TD>
<%= @image.path.split(''/'').last[0..39] %>:
<% if ((! @image.path.nil?) && (@image.path.length > 40)) %>
<%= h("...") %>
<% end %>
</TD>
<TD>
<%=
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
2008 Jun 07
3
DRY validates_format_of?
In a model I have following validates_format_of. Is there an easy way to
DRY this up? It seems to be rather repetitive.
validates_format_of :expiration_date, :with =>
/^[0-9]{4}[-][0-9]{2}[-][0-9]{2}$/
validates_format_of :activation_date, :with =>
/^[0-9]{4}[-][0-9]{2}[-][0-9]{2}$/
validates_format_of :some_other_date, :with =>
2006 Sep 10
1
validates_format_of :something, :with => /REGEX/
Hi all,
I''m hoping to stir the Rails pot a little bit here, so please go easy
with me ;-)
Regular Expressions is the most densely inhumane language construct
ever invented in any ''civilisation'', and the fact that we still have
to dirty our minds with this in Rails is something that (sh/c)ould
ideally be corrected in Rails (preferably before the release of 1.2
2005 Nov 28
4
validates_format_of nil
I''ve noticed that validates_format_of will return invalid if the field
is nil.
Question 1) How should we declare a validation that will validate it
with a regex if it is set, but, if the field is not set, just move on
Question 2) Why is it done this way? The other validators are only
invoked if the field is set . If you want to declare the field
mandatory, you add a
2012 Aug 14
3
validates_format_of :message not working, validates_length_of :message is working
I''m using validates_format_of and the validation I want to do works, but I
can''t get an error message to be displayed if the data is invalid:
validates_format_of :mobile, :with => /\A[\+0-9]+\Z/, :message => " - Wrong"
I have another validation some where else that does display the error
message: " - Name is too long"
validates_length_of :name,
2006 Apr 05
4
validates_format_of ?
Hi all,
I''ve got a form which accepts a "price" field and I''m attempting to
validate it and allow some flexibility in the way the user enters it.
It''s a numeric field but I want the user to be able to enter dollar
signs and commas naturally in the data entry.
I''m trying to understand how to use validates_format_of, and I''m not
sure what
2008 Feb 24
1
validates_format_of no dots allowed
I need a validates_format_of that disallow dots.
In the api there is nothing to find about how validates_format_of exatly
works.
Is there a better documentation or is there something that can tell me
howto disallow dots.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
2009 Oct 20
5
Annoying problem with file_field and paperclip
Hi all,
I have a really really annoying problem that''s driving me nuts with
file_field and paperclip and having to upload images everytime a form is
edited even though the user is quite happy with the currently uploaded
image or loose the previously uploaded image.
This seems to be caused by the rails file_field helper not storing the
data that has been read in from the db in the same
2006 Apr 18
10
Validates_ip_of
Hello all
After being told of a funky date validator I will ask again for another
validator :) Does anyone know of a plugin that validates that a field is
the correct syntax for an IP Address?
Thanks
Jeff
--
Posted via http://www.ruby-forum.com/.
2006 Jan 15
4
file_field vs. file_field_tag
Hi,
The documentation doesn''t make it clear why both file_field and
file_field_tag are both useful. What is the reason for having two
instead of just one of these?
Thanks,
Peter
2006 Mar 29
1
Posting multiple files - how to set up params correctly
All,
I have a page where I am allowing the user to specify multiple image
files that are related to one HTML document.
I want to end up with an array of image files that I can then assign
into an array within the controller.
I''m trying to set up my file_field correctly but am having trouble.
I''m not clear on how "the multiple input tags with the same name turning
into
2010 Jan 18
3
validates_format_of :phone,
validates_format_of :phone,
:with => /\A\s*(?:(?:\+?(?:\d{1,3}(?:\s*|[\-.])))?\(?\d{3}[\-\/)]?\s*)
(?:[2-9][0-9 \-.]{6,})\s*\z/,
i pit it on my reuriments but error whlie entering
666.111.9999
i want it should be ok
any one help me please
--
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 Jan 22
1
file_field questions
A couple questions about file_field elements.
First, with code such as this:
<%= file_field ''attachments'', ''filename'' %>
Would the filename of the file I select be the value that''s stored
within the database under the "filename" column, and then I would just
add in code in my "create" controller to upload the actual file?