Displaying 20 results from an estimated 57 matches for "g0nzo".
2006 Mar 05
4
Resizing images and creating thumbnails
Hi,
1. How to resize an image uploaded by a web form before saving it to the
disk? (i need all uploaded images to have similar size)
2. How to create thumbnails? Is it enough if i specify small size of the
image in html or would the image look horrible? Can i do it somehow in
''realtime'' using javascript? Or is it best to create thumbnail as a
separate file?
3. How to get
2006 Mar 06
5
Question about file_column plugin
Hi!
File_column plugin saves uploaded files to
"public/model/image/model_id/filename", if i understand it correctly.
Does it mean that it creates new folder for every image?
I have product (model) that has_many images (model). Is it possible to
use (or modify) this plugin that it would save my images to different
folder, so the id of the model_id part would be id of the product
2006 Mar 09
7
How to restrict access to admin part of the page?
Hi!
What is the easiest way to restrict access to some part of the page?
In php i just put .htaccess and .htpasswd files in /admin folder and it
worked.
Now i''ve got one admin folder for controllers, one for views, public
folder and i''m not really sure if it''s still possible. So what is the
easiest way? I don''t have any user logging features on my site,
2006 Feb 14
5
problem with apache
Hi!
I don''t know much about linux and apache configuration, so we''re using
cpanel on our server to manage accounts etc.
I was trying to install ror (according to this page:
http://wiki.rubyonrails.org/rails/pages/HowtoInstallAndRunRubyOnRailsOnCpanel)
on our server, but it didn''t worked.
If i enter "server.com/rails" i get "/testapp/index.html was not
2006 Mar 08
3
Many renders in one view?
Hi!
This was probably asked many times, but i can''t find it anywhere.
How to render in my view many actions (sometimes from different
controllers)?
So i.e. I will have user status/login form at the top, form for
creating/editing some data on the left and a list of these data elements
on the right and some other things at the bottom?
Can i put some of this stuff to the layout? So i
2006 Mar 08
3
attribute or instance method or what?
Hi!
Uhm are attributes just something like additional members of a class,
other than those that come from the names of columns in the table?
I''ve got images table, which has ''name'' column. I''ve added support for
creating thumbnails out of uploaded pictures and i''d like to have an
easy way of accessing them in my views.
How to do it? I.e. my image
2006 Mar 04
5
has_many and belongs_to example?
Hi!
If i have 2 tables i.e. product and images and product has_many images,
image belongs_to product - how to create _form.rhtml, new/create and
edit/update methods in product controller, so in a single form i can add
one product and MANY (let''s assume for now that this number is fixed)
images for this product?
Pleeeeease help me :)
--
Posted via http://www.ruby-forum.com/.
2006 Mar 05
2
How to clean up this code?
Hi!
I''ve got 2 tables: products and images. Product has_many images, image
belongs_to product. In images table i store product_id and name of the
image (not the image itself).
I''ve created a single form, where user can add any number of images for
a
product he/she is creating (new fields are created using javascript).
The images that are uploaded are saved to public/images
2006 Feb 24
5
Changing default behavior of fieldWithErrors
Hi!
The topic can be a bit misleading, because it may suggest that i want to
change css style.
What i''d like to change is that normally, when there''s an error, rails
creates a div element with the fieldWithErrors class as the parent of
the input. I''d like to change this behavior, so the input element itself
will have this class added to its current classes and
2006 Apr 21
1
Which internationalization plugin to choose?
Hi,
I need to create rather simple page (gallery + news), but it has to be
in 3 different languages (polish, english, german). Which plugin do you
recommend? How to store translated data in the database - in a single
table with separate field for every language or in separate table for
every language?
--
Posted via http://www.ruby-forum.com/.
2006 Apr 22
0
Re: Rails Digest, Vol 19, Issue 611
...d of my image_tag like so
<%= image_tag url_for_file_column("recipe", "image") rescue "none" %>
and that seems to work. Is there anything wrong with doing things this way?
>
> Message: 4
> Date: Sat, 22 Apr 2006 10:56:20 +0200
> From: szymek <g0nzo@o2.pl>.
> Subject: [Rails] Re: using file_column
> To: rails@lists.rubyonrails.org
> Message-ID: <eaac219fcba4ea4e397503fd1d7bb3f5@ruby-forum.com>
> Content-Type: text/plain; charset=utf-8
>
> You could use latest (svn) version of file_column plugin, which is
> suppose...
2006 Mar 09
2
How to keep formatting of text in textarea?
Hi!
I''ve got a form for creating news and i''d like to keep formatting of the
text in the textarea - if user presses enter twice, or presses space ten
times it should be visible when editing or showing the news.
Probably i should add before_save filter and some regexps for adding
html tags, but i know almost nothing about regexp. Maybe there''s a
simpler way also.
2006 Mar 14
3
How to write ! version of non ! method?
Hi!
How to write i.e. array.join! based on array.join method?
--
Posted via http://www.ruby-forum.com/.
2006 Feb 21
2
Single table inheritance problem
Hi!
Is there anywhere on the net a sample of some basic app (with actions
like create, edit etc.) that uses single table inheritance?
I''m trying to create (my first) app with 2 different types of users and
while it basically works, my code is quite messy.
I.e. i''ve got 2 forms, each for different type of user. To use the same
rhtml files for creating and editing the user, i
2006 Feb 26
1
Help with ruby=>html
Hi!
I''m new to ruby and rails and got problems with using basic methods like
form_tag or link_to etc to create what i need, i.e. to specify css class
or id or name of html elements.
I have problem with understanding rails api (it''s just as an example):
form_tag(url_for_options = {}, options = {}, *parameters_for_url)
what parameters can i pass to form_tag? How to specify
2006 May 03
1
Globalize app example anywhere?
Hi!
Is there anywhere tutorial how to create working application using
globalize plugin?
I need to create a site in 3 different languages and i was suggested to
use globalize plugin. I''ve read a bit on globalize wiki page and pdf
from the presentation available on the same page, but i still can''t
figure out how to use it.
1. Can i translate names of models and columns
2006 Mar 14
3
How to save parent and child objects in a single action?
Hi!
I''m struggling with it for a week. I posted a few similar posts that
cleared up few things (thanks Mark!), but i still don''t know how to do
it properly.
What i''m trying to do is to create parent object and its many children
(images - i tried using file_column, but it''s a topic for another
post)using data from a single form.
I''ve got a working
2006 Mar 23
3
How to redisplay submitted data on validation error?
Hi!
If i have an object it''s easy.
But i''m making a simple contact form and i check if email address is
correct. If it''s not i redisplay the form with the info that there was
an error (should i use redirect_to or render :action? what''s the
difference?), but all previously submitted data is lost.
I tried creating variables using names of the form fields, but
2006 Mar 22
4
How to write this SQL query?
Hi!
Is there rails version of "where column in (value1, value2, ...)"?
I know i could do OR many times, but this way is shorter.
I''m ruby/rails newbie, so i have a problem with converting the hash,
which i''m receving from the search form into the string for :conditions
in find method.
Could i instead of creating one, complicated (for me) query do something
like
2006 Mar 13
6
Specifying none/single/many conditions at the same time
Hi!
It''s rather ruby question than rails...
I have a single ''list'' action where i call paginate method.
I can receive none, 1 or 2 variables that specify conditions for
paginate method.
How to write the code so i can call paginate without conditions if all
conditions variable are nil, with a single condition if one of
conditions variables is not empty and with 2 if