SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Two non-related questions
-
Mar 5, 2007, 15:49 #1
- Join Date
- Sep 2004
- Location
- Phoenix, Az
- Posts
- 551
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Two non-related questions
My first question is on hosting. We have a dedicated server running a few PHP aps. I am this close to building the next app in Ruby, and converting everything else over. My questions is, how hard is it going to be to host a PHP and Rails app side by side? Will it slow down the Rails app due to constraints from the PHP apps?
My second question is this, I found a nl2br equivelent online, and am trying to use it. I put the function into my helper file, but it doesn't seem to do anything when I call it. I have it in the application helper file, thinking this would allow me to call it from anywhere in the app. It's a very simple function, shown here:
Code:def nl2br(s) s.gsub(/n/, '<br>') end
Here is where I call it on my page.
nl2br(@blog.body)
I get no errors, but it doesn't seem to do anything either. Can anyone help?
-
Mar 6, 2007, 05:59 #2
Pretty easy to host the two on the same server. Unless your PHP apps are already straining the server you should be fine. And if the PHP apps are straining the server I'd recommend you get a second one anyway.
Originally Posted by Jhorra
Or use Textile/Markdown/BBCode, which will let you do a lot more than linebreaks if you want.
-
Mar 6, 2007, 09:50 #3
- Join Date
- Sep 2004
- Location
- Phoenix, Az
- Posts
- 551
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Is there any special setup required, I'm not entirely sure how to make them run side by side.
-
Mar 6, 2007, 10:38 #4
- Join Date
- Aug 2005
- Posts
- 986
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The nl2br code was written by an inexperienced Ruby programming coming from PHP ;-). (1) it uses a regex to replace a fixed string...(2) the code doesn't work: it replaces "n" and not newlines.
Code:def nl2br(s) s.gsub "\n", "<br />" end
Bookmarks