how to increase the width of a field in rails

A

anansi

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/neentryco1.jpg

this is my class Entry:

class Entry < ActiveRecord::Base

def self.show_items
find:)all,
:conditions => "date_available <= now()",
:eek:rder => "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
 
C

come

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.
 
C

Chris Carter

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/neentryco1.jpg

this is my class Entry:

class Entry < ActiveRecord::Base

def self.show_items
find:)all,
:conditions => "date_available <= now()",
:eek:rder => "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/rubyonrails-talk

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!
 
A

anansi

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
 
A

anansi

Chris said:
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/rubyonrails-talk

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
 
R

Rick DeNatale

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/popular/ruby

And my most valuable tool in finding information about ruby, or
anything else is http://www.google.com 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-questions.html
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-questions.html#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".
 
A

anansi

@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...

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.


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.


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/popular/ruby

And my most valuable tool in finding information about ruby, or
anything else is http://www.google.com 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-questions.html


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-questions.html#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
 
R

Rick DeNatale

Welcome to the list of people whose questions I will never answer.

Hmmmm,

I guess I'll have to brush up on my biology, I thought that this was
supposed to be a spider:

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

But it seems to be a leech instead.
 
A

anansi

But it seems to be a leech instead.

if you think so plz ignore me...

--
greets

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


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

James Britt

Rick said:
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
 
H

helo

@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...
 
G

Gregory Brown

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

This is such useful content!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top