Template Integration In Rails Application

Hello Guys,

New Template Integration:

Steps:

1. Sylesheets
=> application.css
*= require 'css1'
*= require 'css1'
*= require 'css1'
*= require 'css1'

*= require_tree . 
  Note: It will include all the sytlesheets directory css files

2. Javascripts
=> application.js
//= require '/newfolder/js1'
//= require 'js2'
//= require 'js3'
//= require 'js4'

//= require_tree .
Note: It will include all the javascripts directory js files

3. Images
Include all the Images in Directory of assets folder

4. Font
Include all you in Fonts Directory of assets folder

5. Layout

<!DOCTYPE html>
<html>
<head>
  <title>Healthdax</title>
  <%= stylesheet_link_tag "application" %>
  <%= javascript_include_tag "application" %>  
  <%= csrf_meta_tags %>
</head>
<body>
  <% if notice %>
    <p class="alert alert-success"><%= notice %></p>
  <% end %>
  <% if alert %>
    <p class="alert alert-danger"><%= alert %></p>
  <% end %>
  <%= yield %>
</body>
</html>

6. Create Controller

Filename: welcome_controller.rb

class WelcomeController < ApplicationController
def index;end
end

7. Define Routes
resources :welcome

8. Views => welcome folder => create => index.html.erb

Here you paste all html content

9. Start you browser and then see your template

No comments:

Post a Comment