SitePoint Sponsor |
|
User Tag List
Results 1 to 10 of 10
-
Dec 20, 2005, 14:36 #1
- Join Date
- Apr 2005
- Posts
- 485
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ruby/Rails and PHP? Is It Possible
hi all.
i really like some aspects of RoR and i will be learning and applying it over the next few months.
having said that, i'm a little scared because i'm comfortable using a php forms class to generate linked select boxes (select box 2 changes as select box 1 is updated).
i'm under the impression this is doable in rails, but it isn't trivial - meaning i'll be burning a lot of time getting something usable. burning time doesn't seem like apleasant experience at this juncture - especially when i have it down pat on PHP.
can i mix these technologies on a limited basis or am i just out of luck?
tia...
can php be used in conjunction with rails?
-
Dec 20, 2005, 15:11 #2
- Join Date
- Nov 2001
- Location
- Atlanta, GA, USA
- Posts
- 5,011
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You can use either/or on the same server. You couldn't jump into PHP in the middle of a Rails template if that's what you are asking. But you could have php pages available in your public directory.
Honestly though, doing linked select boxes in Rails with AJAX is pretty easy.
Someone else was asking about this recently:
http://www.sitepoint.com/forums/showthread.php?t=326963
ezmobius1 suggested this link:
http://www.roryhansen.ca/?p=9Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?
-
Dec 20, 2005, 16:32 #3
- Join Date
- Apr 2005
- Posts
- 485
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by samsm
it didn't look easy to me, but i probably haven't just jumped into the "deep end," yet.
time to jump? i think so!
-
Dec 20, 2005, 18:56 #4
- Join Date
- Nov 2001
- Location
- Atlanta, GA, USA
- Posts
- 5,011
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Here's an example I did some time ago:
Code:<% for city in @cities %> <option value="<%= city.id %>"><%= city.name %>, <%= city.state.name %></option> <% end %> </select> <%= observe_field('exact_city', :frequency => 0.25, :update => 'new_checkboxes', :url => { :action => :exact_city }, :with => "'city='+value" ) %> <div id="new_checkboxes"></div>
(and stick to one thread next time!)Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?
-
Dec 23, 2005, 11:18 #5
- Join Date
- Aug 2003
- Location
- Behind You
- Posts
- 116
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It's cool you can use both. I was thinking of developing a frontend of site with PHP but develop the backend using Ruby (gotta love scaffold!). Would that run into any problems?
My links: [ Blog ] - [ deviantArt ]
-
Dec 23, 2005, 12:47 #6
- Join Date
- Nov 2001
- Location
- Atlanta, GA, USA
- Posts
- 5,011
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Packetloss
However, in a situation where you are building something from scratch, I'd wonder what the purpose was. If you are making a backend with Rails, then you are probably setting up relationships in the models which could also be used for the frontend. It seems to me like by doing something in two languages, you might be doing some of the same work twice. You could easily argue that that is a problem.Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?
-
Dec 24, 2005, 07:56 #7
- Join Date
- Nov 2001
- Location
- Bath, UK
- Posts
- 2,498
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Packetloss
DouglasHello World
-
Dec 27, 2005, 16:36 #8
Originally Posted by Packetloss
That's what it was originally designed for, after all.
-
Jan 6, 2006, 10:28 #9
- Join Date
- Mar 2005
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If you want good templates along the lines of Smarty check out LiquidLiquid
-
Jan 10, 2006, 19:13 #10
- Join Date
- Jan 2001
- Location
- Lisboa : Portugal
- Posts
- 418
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Packetloss
I must tell you rhtml is very easy.. I don't know what level of complexity this site will have, but a setup like this probablly wont be worth the extra effort, compared with just runnng everything on rails!Duarte Carrilho da Graça
RailsHelp.com: Searchable Rails reference
CACA: Committee for the Annihilation of Complicated Acronyms
Bookmarks