Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
  1. #1
    Senior Member straight_up's Avatar
    Join Date
    Dec 2003
    Location
    Pennsylvania/Arizona
    Posts
    601
    Member #
    4309
    Dear PHP coders,

    I've been dabbling in Rails just a wee bit. It's pretty cool, but it isn't where PHP is in a few areas: for example, I've done things in PHP that are handled by Rails in an inferior manner. I would have to redefine some Rails helpers to get Rails to do what I want.

    Nevertheless, all this speediness in Rails makes me jealous.

    Can some of you PHP vets just tell me that PHP is still cool?

    Thanks,

    Alan (straight_up)
    I am Alan Hogan (@alanhogan on Twitter). I like PHP, UI/UX design, and OS X.

  2.  

  3. #2
    Senior Member Eddy Bones's Avatar
    Join Date
    Jan 2004
    Location
    Washington, USA
    Posts
    1,054
    Member #
    4651
    PHP is still cool.

    There you go.

  4. #3
    Senior Member straight_up's Avatar
    Join Date
    Dec 2003
    Location
    Pennsylvania/Arizona
    Posts
    601
    Member #
    4309
    Quote Originally Posted by Eddy Bones
    PHP is still cool.

    There you go.
    ahhh! thanks
    I am Alan Hogan (@alanhogan on Twitter). I like PHP, UI/UX design, and OS X.

  5. #4
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Like what exactly? I've found that 99.99% of my "problems" with Rails were due to my ignorance of the framework. Oh, and if you need to "redefine" parts of rails, do it! It's not that difficult. You can even package it up as a plugin and use it on all your apps.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  6. #5
    Senior Member straight_up's Avatar
    Join Date
    Dec 2003
    Location
    Pennsylvania/Arizona
    Posts
    601
    Member #
    4309
    It's Brak! The Rails whore! haha.

    Like how there doesn't seem to be a good way to add a proper <label for=""> for a form item generated with Rails' quick field_tag() or whatever.
    I am Alan Hogan (@alanhogan on Twitter). I like PHP, UI/UX design, and OS X.

  7. #6
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Quote Originally Posted by straight_up
    It's Brak! The Rails whore! haha.

    Like how there doesn't seem to be a good way to add a proper <label for=""> for a form item generated with Rails' quick field_tag() or whatever.
    Well, the field helpers don't make labels at all. They just make the stuff like [minicode]<input type="text" id="model_field" name="model[field]" />[/minicode] I usually end up doing these by hand, usually something like:

    Code:
    <label for="user_login">Login:</label> <%= text_field :user, :login %>
    Though, to be fair you could just as easily make your own helper. Try out something like this in your application_helper.rb:

    Code:
    def label_text_field (object, method, options = {})
      ret = "<label for=\"#{object}_#{method}\">#{options[:label]}</label>"
      ret + text_field(object, method, options)
    end
    Then, in your view use this:

    Code:
    <%= label_text_field :user, :login, :label => "Login:" %>
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  8. #7
    Senior Member straight_up's Avatar
    Join Date
    Dec 2003
    Location
    Pennsylvania/Arizona
    Posts
    601
    Member #
    4309
    thanks Brak. I'll have to try that next time I dabble in Rails.
    I am Alan Hogan (@alanhogan on Twitter). I like PHP, UI/UX design, and OS X.

  9. #8
    Senior Member straight_up's Avatar
    Join Date
    Dec 2003
    Location
    Pennsylvania/Arizona
    Posts
    601
    Member #
    4309
    Quote Originally Posted by Brak
    Well, the field helpers don't make labels at all. They just make the stuff like [minicode]<input type="text" id="model_field" name="model[field]" />[/minicode] I usually end up doing these by hand, usually something like:

    Code:
    <label for="user_login">Login:</label> <%= text_field :user, :login %>
    How do you know that the ID there will be "user_login"? And, supposing you used the same helper/text field twice on a page, would you have two instances of an element with an id="user_login"?
    I am Alan Hogan (@alanhogan on Twitter). I like PHP, UI/UX design, and OS X.

  10. #9
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    And, supposing you used the same helper/text field twice on a page, would you have two instances of an element with an id="user_login"?
    Think about what you're asking again, and then come back to me


    Yes, I do know it will be called that because of the way the helpers work. They come out as model_field,
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  11. #10
    Senior Member straight_up's Avatar
    Join Date
    Dec 2003
    Location
    Pennsylvania/Arizona
    Posts
    601
    Member #
    4309
    yeah it sounds weird but i could have the same login form, say, twice on a page. Or two different forms with similar properties.
    I am Alan Hogan (@alanhogan on Twitter). I like PHP, UI/UX design, and OS X.


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:22 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com