Tuesday, December 4, 2012

Re: [Rails] Can not render pre designed html template from public directory

On 3 December 2012 20:36, John <mr.johnamato@gmail.com> wrote:
> Hello,
> I have a designed template public/test/show.html with following sample html
> code. There is a css file and images in the mentioned directory.
>
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1"/>
> <link href="css/style.css" rel="stylesheet" type="text/css"
> media="all"/>
> </head>
> <body>
> <div class="title">Post: {post_name}</div>
> </body>
> </html>
>
> I have a posts controller and need to render this template from posts#show
> without changing anything under public/test directory. And, replace
> {post_name}
> by post name.
>
> I've tried that in many ways to do that but couldn't. Specially, the css and
> images path not working any way. It's always looking under
> http://localhost:3000/posts/{....}

I am not sure what you are trying to do exactly but I think your whole
approach is probably wrong, it is certainly not conventional. I
suggest you work right through a good tutorial such as
railstutorial.org (which is free to use online) so that you will
understand the basics of rails.

Colin

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate