Skip to content

combinaut/responsive_preview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ResponsivePreview

Rack Middleware gem that injects an iframe around the response for the purpose of testing responsive css at different breakpoints.

Usage

Define when the responsive preview is shown

class MyController < ApplicationController
  def wants_responsive_preview?
    # some condition to decide when to view the page in the responsive preview layout
  end
end

Provide a responsive preview layout

<!-- app/views/layouts/responsive_preview.html.erb -->

<!-- Add some other chrome for switching devices/iframe dimensions -->
<%= content_tag :iframe, '', srcdoc: yield %>
<%= responsive_preview_js %>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •