Marnen Laibow-Koser wrote:
> Ralph Shnelvar wrote:
>> Marnen Laibow-Koser wrote:

>>>> So ... what in Rails initializes the fields of a form?
>>> 

Ok ... this code is/was provided as example code from
http://www.rubyplus.org/episodes/20-Extended-RESTful-Authentication-Rails-2-App.html

I downloaded the movie and the source code ... neither of which seem to
be available any more

Attached, a screenshot.  Where "Dave" (I presume "Dave Thomas") came
from is completely beyond me.
>>> If you're using form_for -- and you didn't say if you were! -- then the 
>>> form is initialized from the supplied model object.
>> 
>> 
>> 
>> Ok ... here's the code
>> 
>> ---------------------------------------------
>> 
>> \zauth\app\views\users\new.html.erb
> 
> Note: This isn't relevant to the issue at hand, but I *highly* recommend 
> Haml instead of ERb.
> 
>> <fieldset>
>> <legend>Signup for eMeantime Membership</legend>
>> <%= error_messages_for :user %>
>> 
>>  <% form_for :user, :url => users_path  do |f| -%>
>> 
>>   <p><label for="login">Login:</label><br/>
>>   <%= f.text_field :login %> <br/>
>>   <cite>Ex., aedenfield</cite>
>> 
>>   <p><label for="email">Email:</label><br/>
>>   <%= debugger; '' -%>
>>   <%= f.text_field :email %><br/>
>>   <cite>Ex., [email protected]. A valid email is required for an active 
>> account.</cite>
> 
> <cite> is for book titles, not hints.  Learn to use HTML properly.

Thank you ... but I did not write that code.  I believe a person by the 
name of Bala Paranj 
(http://www.rubyplus.org/episodes/20-Extended-RESTful-Authentication-Rails-2-App.html)
 
created a video tutorial as well as source code.  I downloaded both ... 
both seem to be inaccessible now.

> 
>> 
>>   <p><label for="password">Password:</label><br/>
>>   <%= f.password_field :password %><br/>
> 
> This all looks fine.
> 
> [...]
>> I apologize for the length of the code but since I am lost as to where 
>> in the model the code initializes the form ... I provided everything.
> 
> Read the form_for docs and the Rails guides.

What do you think I've been doing for the last several weeks?

> 
>> 
>> 
>> The fields that seem to be inappropriately initialized are the fields 
>> associated with :email (definitely) and :password (maybe).
> 
> Initialized with what?  You've provided everything but the essential 
> info. :)
>> 
>> The :password field has big dots in it ... and it _may_ be initialized 
>> ... I can't tell.
> 
> What do you mean, you can't tell?  What is the generated HTML like?

The screen shot (attached) source looks like this:

---------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en-US">

<head>
  <title>Killer App of 2008</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <link href="/stylesheets/style.css?1198972466" media="screen" 
rel="stylesheet" type="text/css" />

  <script src="/javascripts/prototype.js?1261074000" 
type="text/javascript"></script>
<script src="/javascripts/effects.js?1261074000" 
type="text/javascript"></script>

<script src="/javascripts/dragdrop.js?1261074000" 
type="text/javascript"></script>
<script src="/javascripts/controls.js?1261074000" 
type="text/javascript"></script>
<script src="/javascripts/application.js?1261074000" 
type="text/javascript"></script>
</head>

  <body>

<!-- ##### Header ##### -->
  <div id="header">
    <div class="superHeader">

        <span>Welcome Guest</span>


    </div>

      <div class="midHeader">
        <h1 class="headerTitle" lang="la">Killer App of 2008</h1>
        <div class="headerSubTitle" title="Killer App of 2008">
          How can I help you?
        </div>
      </div>

    <div class="subHeader">

    <span class="doNotDisplay">Navigation:</span>

     <a href="http://localhost:3000/signup";>Signup</a>
     | <a href="http://localhost:3000/login";>Login</a>

    | <a href="contact">Contact Us</a>
    </div>

    </div>

    <!-- ##### Main Copy ##### -->

    <div id="main-copy">



    <fieldset>
<legend>Signup for eMeantime Membership</legend>


 <form action="/users" method="post"><div 
style="margin:0;padding:0"><input name="authenticity_token" 
type="hidden" value="f855b5f22afb03895860d163968b48a2ec9973cb" /></div>
  <p><label for="login">Login:</label><br/>

  <input id="user_login" name="user[login]" size="30" type="text" /> 
<br/>
  <cite>Ex., aedenfield</cite>

  <p><label for="email">Email:</label><br/>
    <input id="user_email" name="user[email]" size="30" type="text" 
/><br/>
  <cite>Ex., [email protected]. A valid email is required for an active 
account.</cite>

  <p><label for="password">Password:</label><br/>

  <input id="user_password" name="user[password]" size="30" 
type="password" /><br/>
  <cite> Enter the password that is between 4 and 40 characters in 
length.</cite>

  <p><label for="password_confirmation">Confirm Password:</label><br/>
  <input id="user_password_confirmation" 
name="user[password_confirmation]" size="30" type="password" /><br/>
  <cite>Enter the same password as above.</cite>

  <p><input name="commit" type="submit" value="Sign up" /></p>

</form>
</fieldset>


    </div>


    <!-- ##### Footer ##### -->

    <div id="footer">
      <div>
        Copyright &copy; 2009 - 2010, eMeantimeo.com
      </div>

    </div>
  </body>
</html>
---------------------------------------

Attachments:
http://www.ruby-forum.com/attachment/4338/snapshot001.jpg

-- 
Posted via http://www.ruby-forum.com/.

--

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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to