I know I'm crazy but

I have data in my database that I want processed like rhtml. Can I do
that? I’m saving my site content in there, and suddenly thought it
would be brilliant to show “<%= “You are logged in as
#{@user.username}.” %>” and other stuff. Is this possible/easy?

kopf1988 wrote:

I have data in my database that I want processed like rhtml. Can I do
that? I’m saving my site content in there, and suddenly thought it
would be brilliant to show “<%= “You are logged in as
#{@user.username}.” %>” and other stuff. Is this possible/easy?

It is possible. See the Globalize plugin for details on how to do it.

Is there an… easier way to do it? Installing plugins is a pain on
shared hosts.

On Jan 19, 9:13 pm, James B. [email protected]

kopf1988 wrote:

Is there an… easier way to do it? Installing plugins is a pain on
shared hosts.

On Jan 19, 9:13 pm, James B. [email protected]

I was not suggesting that you use Globalize, only that if you wish to
see how a database driven user interface is implemented then this is the
most comprehensive example for Rails that I am aware of. You can
examine it to determine how various features are enabled in code and
then adopt/adapt whatever parts you deem meet your specific desires.

At a minimum you must wrap all application text strings that are
presented to the user in some form of method that will perform the
lookup and return from the database backend.

Hmmm… maybe they won’t be so hard then, I’ll have to try.

Oh, and I found the answer!!!

render :inline

Unless that’s a bad idea, lol, but it’s just going to be used to
render my webpages layouts which I can handily store in the database
now.

On Jan 19, 9:34 pm, James B. [email protected]

kopf1988 wrote:

Installing plugins is a pain on shared hosts.

I can see gems being a PITA but why so for plugins? They go directly
into your project and as far as the host is concerned they are part of
your project, no different than any code that you write yourself.

No it’s not. Go into your Rails directory and run:

script/plugin install http://www.yourrepos.com/plugin_directory

Plugins are local to your Rails application directory so being on
shared hosting shouldn’t affect them at all.

–Jeremy

On Jan 19, 2008 10:19 PM, kopf1988 [email protected] wrote:

#removed_email_address@domain.invalid}." %>" and other stuff. Is this possible/easy?

It is possible. See the Globalize plugin for details on how to do it.

Posted viahttp://www.ruby-forum.com/.


http://www.jeremymcanally.com/

My books:
Ruby in Practice

My free Ruby e-book

My blogs:

http://www.rubyinpractice.com/

No command line access…

Besides, Globalization is something that has features absolutely
trivial to my purpose. Isn’t there something specific to that? I
really hate to install a bunch of stuff just to get one tiny little
feature out of it.

On Jan 19, 9:23 pm, “Jeremy McAnally” [email protected]

Just remember, doing this means that someone will have an easy way to
executing arbitrary ruby code on your website in case they get access
to the database.

(Which is, of course, a major security flaw).

Right, right. But rails doesn’t come with something simple like this??

render :rhtml => “Text string. <%= @something.words %>”

On Jan 19, 9:31 pm, James B. [email protected]

whats wrong with

render :text => "Text string. " + @something.words