[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

how to increase the width of a field in rails

mrpink

5/2/2007 5:40:00 PM

Hi,
when I created a scaffold for the input of some data ,the following was
created as new.rhtml:

<h1>New entry</h1>

<% form_tag :action => 'create' do %>
<%= render :partial => 'form' %>
<%= submit_tag "Create" %>
<% end %>

<%= link_to 'Back', :action => 'list' %>

this is the view which shows the following:
http://img115.imageshack.us/img115/9167/neen...

this is my class Entry:

class Entry < ActiveRecord::Base

def self.show_items
find(:all,
:conditions => "date_available <= now()",
:order => "date_available desc")
end

validates_presence_of :headline,:news
validates_uniqueness_of :headline, :news
end

and this are the important lines from the corresponding controller:

def new
@entry = Entry.new
end

def create
@entry = Entry.new(params[:entry])
if @entry.save
flash[:notice] = 'Entry was successfully created.'
redirect_to :action => 'list'
else
render :action => 'new'
end
end

where do I have to make the changes for the display. I want to give the
"News" field you can see on the screenshot more width but dunno how to do.



--
greets

(
)
(
/\ .-"""-. / //\\/ ,,, \//\ |/\| ,;;;;;, |/\|
//\\\;-"""-;///\ // \/ . \/ \ (| ,-_| \ | / |_-, |)
//`__\.-.-./__`\ // /.-(() ())-.\ \ (\ |) '---' (| /)
` (| |) `
jgs \) (/


one must still have chaos in oneself to be able to give birth to a
dancing star
11 Answers

come

5/3/2007 7:53:00 AM

0

Hi,

It's a quite basic question about rails.. Are you sure you shouldn't
read a book about rails ;-) ?
Moreover, I'm not sure it is the right goup to post about rails, too.

In your view new.rhtml, you have this instruction :

<%= render :partial => 'form' %>

That means you have a "sub-view" named "_form.rhtml".
In this sub view, you should find a line like this :

<%= text_area 'entry', 'news' %></p>

You could add options to this line like ":cols => nnn" and ":row =>
nnn" to increase the size of this forms area.

On 2 mai, 19:39, anansi <kaz...@oleco.net> wrote:
> Hi,
> when I created a scaffold for the input of some data ,the following was
> created as new.rhtml:
>
> <h1>New entry</h1>
>
> <% form_tag :action => 'create' do %>
> <%= render :partial => 'form' %>
> <%= submit_tag "Create" %>
> <% end %>
>
> <%= link_to 'Back', :action => 'list' %>
>

Chris Carter

5/3/2007 11:59:00 AM

0

On 5/2/07, anansi <kazaam@oleco.net> wrote:
> Hi,
> when I created a scaffold for the input of some data ,the following was
> created as new.rhtml:
>
> <h1>New entry</h1>
>
> <% form_tag :action => 'create' do %>
> <%= render :partial => 'form' %>
> <%= submit_tag "Create" %>
> <% end %>
>
> <%= link_to 'Back', :action => 'list' %>
>
> this is the view which shows the following:
> http://img115.imageshack.us/img115/9167/neen...
>
> this is my class Entry:
>
> class Entry < ActiveRecord::Base
>
> def self.show_items
> find(:all,
> :conditions => "date_available <= now()",
> :order => "date_available desc")
> end
>
> validates_presence_of :headline,:news
> validates_uniqueness_of :headline, :news
> end
>
> and this are the important lines from the corresponding controller:
>
> def new
> @entry = Entry.new
> end
>
> def create
> @entry = Entry.new(params[:entry])
> if @entry.save
> flash[:notice] = 'Entry was successfully created.'
> redirect_to :action => 'list'
> else
> render :action => 'new'
> end
> end
>
> where do I have to make the changes for the display. I want to give the
> "News" field you can see on the screenshot more width but dunno how to do.
>
>
>
> --
> greets
>
> (
> )
> (
> /\ .-"""-. /> //\\/ ,,, \//\> |/\| ,;;;;;, |/\|
> //\\\;-"""-;///\> // \/ . \/ \> (| ,-_| \ | / |_-, |)
> //`__\.-.-./__`\> // /.-(() ())-.\ \> (\ |) '---' (| /)
> ` (| |) `
> jgs \) (/
>
>
> one must still have chaos in oneself to be able to give birth to a
> dancing star
>
>

Hi anansi, I cannot help but notice that you have been asking a
considerable number of Rails questions on the Ruby list. There is
another list setup by the rails people for questions relating
specifically to rails. We prefer people ask rails questions on that
list, because there is a higher chance of getting a proper answer from
all those rails people. You wouldn't ask a Ruby question on a C
newsgroup because ruby is implemented in C.

http://groups.google.com/group/rubyon...

Unfortunately they do not have a Usenet gateway like we do, so you
will have to bite and use the web interface.

Welcome to Ruby!
--
Chris Carter
concentrationstudios.com
brynmawrcs.com

mrpink

5/3/2007 12:42:00 PM

0

first thanks for your answer, it worked great :)

but do you know a cheat sheet or a summary of rails objects and their
methods because this is my _form.rhtml:

<%= error_messages_for 'entry' %>

<!--[form:entry]-->
<p><label for="entry_headline">Headline</label><br/>
<%= text_field 'entry', 'headline' %></p>

<p><label for="entry_news">News</label><br/>
<%= text_area 'entry', 'news',:cols => 100 %></p>

<p><label for="entry_date_available">Date available</label><br/>
<%= datetime_select 'entry', 'date_available'%></p>
<!--[eoform:entry]-->


you see ,:cols => 100 works nicely for text_area but not for text_field
above... is there a list of these objects or classes and their methods?




--
greets

(
)
(
/\ .-"""-. / //\\/ ,,, \//\ |/\| ,;;;;;, |/\|
//\\\;-"""-;///\ // \/ . \/ \ (| ,-_| \ | / |_-, |)
//`__\.-.-./__`\ // /.-(() ())-.\ \ (\ |) '---' (| /)
` (| |) `
jgs \) (/


one must still have chaos in oneself to be able to give birth to a
dancing star

mrpink

5/3/2007 2:28:00 PM

0

Chris Carter wrote:
> Hi anansi, I cannot help but notice that you have been asking a
> considerable number of Rails questions on the Ruby list. There is
> another list setup by the rails people for questions relating
> specifically to rails. We prefer people ask rails questions on that
> list, because there is a higher chance of getting a proper answer from
> all those rails people. You wouldn't ask a Ruby question on a C
> newsgroup because ruby is implemented in C.
>
> http://groups.google.com/group/rubyon...
>
> Unfortunately they do not have a Usenet gateway like we do, so you
> will have to bite and use the web interface.
>
> Welcome to Ruby!
Hi Chris,
well first of all I didn't knew that this newsgroup is limited to just
some aspects of ruby, maybe you should do some white- or black-listing
on topics if you think mine wouldn't fit here.
But every question I droped was answered here very fast and correclty
because as I thought it is obvious that many ppl who uses the Rails
framework also suscribed to the ruby-list.

And about the rails (not mailing- and not newsgroup) but google.group:
you really think it's clever to be forced to register (when I wanna sign
up to this list I always get: "You must sign in to Google to complete
the previous action.") to one of the greatest commercial companys on the
planet in order to get knowledge about one of the most free programming
languages on the planet? I don't think so ;)

I mean, I'm sure you also realized that ruby never succeded in the step
to spread his information over http and any good forums or websites
about ruby are more rare than unicorns... so please let me this
newsgroup because it kicks ass :)



--
greets

(
)
(
/\ .-"""-. / //\\/ ,,, \//\ |/\| ,;;;;;, |/\|
//\\\;-"""-;///\ // \/ . \/ \ (| ,-_| \ | / |_-, |)
//`__\.-.-./__`\ // /.-(() ())-.\ \ (\ |) '---' (| /)
` (| |) `
jgs \) (/


one must still have chaos in oneself to be able to give birth to a
dancing star

Rick DeNatale

5/3/2007 2:57:00 PM

0

On 5/3/07, anansi <kazaam@oleco.net> wrote:

> well first of all I didn't knew that this newsgroup is limited to just
> some aspects of ruby, maybe you should do some white- or black-listing
> on topics if you think mine wouldn't fit here.
> But every question I droped was answered here very fast and correclty
> because as I thought it is obvious that many ppl who uses the Rails
> framework also suscribed to the ruby-list.

This may be, but in general, you'll find more rails expertise on the
rails group. I've seen lots of rails-related questions go unanswered
here because no one with the right rails knowledge saw it.

> And about the rails (not mailing- and not newsgroup) but google.group:
> you really think it's clever to be forced to register (when I wanna sign
> up to this list I always get: "You must sign in to Google to complete
> the previous action.") to one of the greatest commercial companys on the
> planet in order to get knowledge about one of the most free programming
> languages on the planet? I don't think so ;)

That's a question for the rails community rather than the general ruby
community, and even though it might be a catch-22 situation, the ruby
list is where it should be raised.

> I mean, I'm sure you also realized that ruby never succeded in the step
> to spread his information over http and any good forums or websites
> about ruby are more rare than unicorns...

Hmm, you must not be looking very hard. I've got about 50 different
Ruby oriented blogs in the list of rss feeds I look at. You might
also want to use resources like del.icio.us.
http://del.icio.us/po...

And my most valuable tool in finding information about ruby, or
anything else is http://www.... although again for you that
might be a catch-22.

This isn't directed at you personally, but a lot of questions get
asked here and on other fora which exhibit evidence that the
questioner hasn't done his homework before asking the question.
Questions are much more likely to get answered if the question shows
that the questioner has tried to solve the problem himself first, and
gives clear context information about where he's gotten stuck.

Of course this is just reiterating part of the canonical exposition on
how to ask smart questions:
http://www.catb.org/~esr/faqs/smart-ques...

> so please let me this
> newsgroup because it kicks ass :)

No one says you can't, just don't be surprised if you don't get all of
your rails questions answered, and occasionally get a response which
suggests checking the rails group.

Again quoting ESR:

"Know what your topic is! One of the classic mistakes is asking
questions about the Unix or Windows programming interface in a forum
devoted to a language or library or tool portable across both. If you
don't understand why this is a blunder, you'd be best off not asking
any questions at all until you get it."
http://www.catb.org/~esr/faqs/smart-ques...#forum

This seems to map directly to asking about rails in a ruby-language
forum. If this were a more typical usenet technical forum you might
get treated much more rudely.

Luckily , for all of us, ruby-lang seems to be one of the more genteel
forums on the "interwebs".


--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denh...

mrpink

5/3/2007 3:26:00 PM

0

@Rick DeNatale :
First, thx for this really great delicious link. Second, of course it is
obvious that I would get more answers on a rails list but as said: at
least at the moment I see absolutly no need to sign-up with google just
to get an answer I can simply get here.

I also don't think it as spamming as your posting sounds like because
that's a ruby-list and all my question are strictly and only related to
ruby and no other programming language so posting in a C group would be
totally different...

And the rest I don't get right: you think I'm posting here if I would
see a better or faster way to get the same information by myself?!?
makes not much sense.. at least in my eyes...

And you can be sure I penetrated google before I'm asking here. I mean
now that I know that text_area is affected in this issue it is easy to
find the right answer with google but try to find it without this
keyword... I didn't succeed so I asked here, got an answer and that's
it. Next time I don't have to ask how to change these views because now
I know the meaning of render :partial =>... Before come's answer here I
didn't even expect it to have something to do with my issue.

I really don't get why some ppl are now feeling pissed of by me...


> On 5/3/07, anansi <kazaam@oleco.net> wrote:
>
>> well first of all I didn't knew that this newsgroup is limited to just
>> some aspects of ruby, maybe you should do some white- or black-listing
>> on topics if you think mine wouldn't fit here.
>> But every question I droped was answered here very fast and correclty
>> because as I thought it is obvious that many ppl who uses the Rails
>> framework also suscribed to the ruby-list.
>
> This may be, but in general, you'll find more rails expertise on the
> rails group. I've seen lots of rails-related questions go unanswered
> here because no one with the right rails knowledge saw it.
>
>> And about the rails (not mailing- and not newsgroup) but google.group:
>> you really think it's clever to be forced to register (when I wanna sign
>> up to this list I always get: "You must sign in to Google to complete
>> the previous action.") to one of the greatest commercial companys on the
>> planet in order to get knowledge about one of the most free programming
>> languages on the planet? I don't think so ;)
>
> That's a question for the rails community rather than the general ruby
> community, and even though it might be a catch-22 situation, the ruby
> list is where it should be raised.
>
>> I mean, I'm sure you also realized that ruby never succeded in the step
>> to spread his information over http and any good forums or websites
>> about ruby are more rare than unicorns...
>
> Hmm, you must not be looking very hard. I've got about 50 different
> Ruby oriented blogs in the list of rss feeds I look at. You might
> also want to use resources like del.icio.us.
> http://del.icio.us/po...
>
> And my most valuable tool in finding information about ruby, or
> anything else is http://www.... although again for you that
> might be a catch-22.
>
> This isn't directed at you personally, but a lot of questions get
> asked here and on other fora which exhibit evidence that the
> questioner hasn't done his homework before asking the question.
> Questions are much more likely to get answered if the question shows
> that the questioner has tried to solve the problem himself first, and
> gives clear context information about where he's gotten stuck.
>
> Of course this is just reiterating part of the canonical exposition on
> how to ask smart questions:
> http://www.catb.org/~esr/faqs/smart-ques...
>
>> so please let me this
>> newsgroup because it kicks ass :)
>
> No one says you can't, just don't be surprised if you don't get all of
> your rails questions answered, and occasionally get a response which
> suggests checking the rails group.
>
> Again quoting ESR:
>
> "Know what your topic is! One of the classic mistakes is asking
> questions about the Unix or Windows programming interface in a forum
> devoted to a language or library or tool portable across both. If you
> don't understand why this is a blunder, you'd be best off not asking
> any questions at all until you get it."
> http://www.catb.org/~esr/faqs/smart-ques...#forum
>
> This seems to map directly to asking about rails in a ruby-language
> forum. If this were a more typical usenet technical forum you might
> get treated much more rudely.
>
> Luckily , for all of us, ruby-lang seems to be one of the more genteel
> forums on the "interwebs".
>
>


--
greets

(
)
(
/\ .-"""-. / //\\/ ,,, \//\ |/\| ,;;;;;, |/\|
//\\\;-"""-;///\ // \/ . \/ \ (| ,-_| \ | / |_-, |)
//`__\.-.-./__`\ // /.-(() ())-.\ \ (\ |) '---' (| /)
` (| |) `
jgs \) (/


one must still have chaos in oneself to be able to give birth to a
dancing star

James Britt

5/3/2007 6:36:00 PM

0

Rick DeNatale wrote:
> On 5/3/07, anansi <kazaam@oleco.net> wrote:
>
>> well first of all I didn't knew that this newsgroup is limited to just
>> some aspects of ruby, maybe you should do some white- or black-listing
>> on topics if you think mine wouldn't fit here.
>> But every question I droped was answered here very fast and correclty
>> because as I thought it is obvious that many ppl who uses the Rails
>> framework also suscribed to the ruby-list.
>
> This may be, but in general, you'll find more rails expertise on the
> rails group. I've seen lots of rails-related questions go unanswered
> here because no one with the right rails knowledge saw it.

More generally, people are asked to direct library-specific questions to
their specific lists or forums because there are many, many Ruby
libraries and apps.

It may be simplest for you to post Rails questions to the general Ruby
list, but the same holds true for people with questions abut Nitro,
Mechanize, Mongrel, RedCloth, Capistrano, and so on. If people are
freely asking and answering Rails-specific questions here, I would
expect other people to feel, quite understandably, entitled to ask their
own library-specific questions here as well. And everyone loses in the
end because of the noise level. There's a *reason* for these other lists.

There is not always a clear line as to when a question belongs on one
list or another, but for the most part, if a list or group exists for an
app or library, that's the place to try first. I empathize with people
who have trouble getting help on other lists, but only to the extent
they've shown good faith in trying to do it the right way first.

While I'm disappointed (but, sadly, not too surprised) at the tone of
some people who responded to you, they are ultimately correct.

You'll win no friends here by complaining about having to use Google
groups in order to learn Rails.

--
James Britt

"In Ruby, no one cares who your parents were, all they care
about is if you know what you are talking about."
- Logan Capaldo

helo

5/15/2007 1:57:00 PM

0

On May 3, 5:30 pm, anansi <kaz...@oleco.net> wrote:
> @Rick DeNatale :
> First, thx for this really great delicious link. Second, of course it is
> obvious that I would get more answers on a rails list but as said: at
> least at the moment I see absolutly no need to sign-up with google just
> to get an answer I can simply get here.

if you so terribly mind signing up with google to follow the rails
group, maybe you should consider the rubyonrails channel on
irc:freenode.net...


Gregory Brown

5/15/2007 2:10:00 PM

0

On 5/2/07, anansi <kazaam@oleco.net> wrote:

>
> (
> )
> (
> /\ .-"""-. /> //\\/ ,,, \//\> |/\| ,;;;;;, |/\|
> //\\\;-"""-;///\> // \/ . \/ \> (| ,-_| \ | / |_-, |)
> //`__\.-.-./__`\> // /.-(() ())-.\ \> (\ |) '---' (| /)
> ` (| |) `
> jgs \) (/
>

This is such useful content!

kmcvay

6/15/2009 3:00:00 PM

0

In article <aussies_suck-C94EF5.00471215062009@aries.ka.weretis.net>,
I'll Always Be 15/06/09 <aussies_suck@invalid.invalid> wrote:
>In article
><8UmZl.30794$Db2.15936@edtnps83>,
> "Truthseeker" <kurtus@citywest.ca>
> wrote:
>
>> Yes sir and this how the hollow industries works. Just about the same as the
>> witness for the prosecution can not be gross examined.
>
>He was cross examined yesterday

But was he GROSS examined yesterday?

149 Statements Illustrating Leading Revisionist Scholar Kurt Knoll's
strict adherence to the highest intellectual standards of Holocaust
denial... folks, with intellects like Knoll's to guide them, Holocaust
deniers cannot but slaver in his footsteps:

(See http://www.nizkor.org/hweb/people/k/k... for
the first 145 -- (Honest, Folks, I'm not making them up!)

146. "The decision of a Jude I mostly not neutral basically he has
to follow the law. In the holocaust trial he has to be very
careful not to please the Jews or his courier is over."
<PFePl.28250$PH1.10279@edtnps82>, May 15, 2009

147. "Interesting another new story. How pig was the whole in the
roof," <IaeTl.28248$Db2.27251@edtnps83>, May 27, 2009

148. "The holocaust is not under investigation by the pope what
is it you are trying to twist around. as for the pope
I am an athirst you can keep him." <dLyUl.28806$Db2.14192@edtnps83>,
May 31, 2009

149. "Look for what I have read many German news papers did you."
<aGbYl.30184$Db2.22147@edtnps83>, June 11, 2009
--
Has Edmonton's William Grosvenor obeyed the Court's
orders yet, and paid the $50,000 in damages and
additional substantial costs to Mr. Warman?
Tell it to the Judge: http://william-gros...