layout - view not rendered properly in rails -
i have model - products, productscontroller , layout product. declared layout inside controller. added css/js/images app assets folder. did rails guide told me when want have custom layout. still doesn't show layout declared shows me default page without formatting , settings.
my files follows
products controller
class productscontroller < applicationcontroller layout "product" # /products # /products.json def index @products = product.all respond_to |format| format.html # index.html.erb format.json { render json: @products } end end end and layout file
<!doctype html> <html> <head> <title>cool amazon products</title> <%= stylesheet_link_tag "application" %> <%= stylesheet_link_tag "bootstrap" %> <%= stylesheet_link_tag "bootstrap-responsive" %> <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> </head> <body> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <a class="brand" href="#">cool products amazon</a> </div> </div> </div> <%= yield %> <%= javascript_include_tag "bootstrap" %> </body> </html> the index.html.erb 1 generated default!.
i using twitter bootstrap ui. please let me know if i'm missing inorder display correct layout.
ok, weird, should work.
so, things check:
- are in development environment, or have restarted rails app?
- are using page or action caching, , you're not clearing them?
- could caching issue on web server?
that's causing this.
Comments
Post a Comment