<%= something %>, seems you miss a % @page is passed from controller to
view as it is instance variable, so name should be same


On Wed, Apr 24, 2013 at 1:48 AM, Kunal Patel <[email protected]> wrote:

> I am using Learningrails.com tutorials and I am on lesson 10. I am having
> a few issues:
>
> 1) I cannot find a way to render the HTML tags. The method they used was
> insert in the controller/viewer_controller :
>           class ViewerController < ApplicationController
>             def show
>               @page = Page.find_by_name(params[:name])
>             end
>           end
>
> and in the views/viewer/show.html.erb:
>             <%= @pagethe.body >   (*i get an error using this syntax, when
> i just input <%= @page > the page works but the HTML tags are still not
> rendered)
>
> I end up with a blank page with my layout still intact but no text, not
> even the text wrapped in a HTML tag.
>
> 2) I cannot find a way correctly shorten the URL. Their method was to
> insert in the routes.rb : view_page ':name', :controller => 'viewer',
> :action => 'show'. But i keep getting an error "No route matches [GET]
> "/home"
>
> Can someone please help me?
>
> I am using rails 3.0; in the tutorial they are using an older method.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-talk/-/0MIkLiCv5KEJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to