CINXE.COM

ActiveStorage::Representations::RedirectController

<!DOCTYPE html> <html lang="en"> <head> <title>ActiveStorage::Representations::RedirectController</title> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width,initial-scale=1"> <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../../../css/panel.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" /> <script src="../../../js/jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/turbolinks.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/search_index.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/searcher.js" type="text/javascript" charset="utf-8"></script> <script src="../../../panel/tree.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/searchdoc.js" type="text/javascript" charset="utf-8"></script> <meta name="data-rel-prefix" content="../../../"> <meta name="data-tree-keys" content='["ActiveStorage", "Representations", "RedirectController"]'> <meta property="og:title" value="ActiveStorage::Representations::RedirectController"> <meta name="description" content="Take a signed permanent reference for a blob representation and turn it into an expiring service URL for download. WARNING: All Active Storage controllers are publicly accessible by default."> <meta property="og:description" content="Take a signed permanent reference for a blob representation and turn it into an expiring service URL for download. WARNING: All Active Storage controllers are publicly accessible by default."> <meta name="keywords" content="ActiveStorage::Representations::RedirectController class, show"> </head> <body> <a class="sr-only sr-only-focusable" href="#content" data-turbolinks="false">Skip to Content</a> <a class="sr-only sr-only-focusable" href="#search" data-turbolinks="false">Skip to Search</a> <input type="checkbox" id="hamburger" class="panel_checkbox"> <label class="panel_mobile_button" for="hamburger"><span></span> Menu</label> <nav class="panel panel_tree" id="panel" data-turbolinks-permanent> <div class="header"> <input type="text" placeholder="Search (/) for a class, method, ..." autosave="searchdoc" results="10" id="search" autocomplete="off" tabindex="-1" /> <label class="panel_mobile_button_close" for="hamburger"><span></span> Close</label> </div> <div class="tree"> <ul> </ul> </div> <div class="result"> <ul> </ul> </div> <a href="links.html" id="links">index</a> </nav> <div class="banner"> <span>Ruby on Rails 8.0.0</span><br /> <h2> <span class="type">Class</span> ActiveStorage::Representations::RedirectController <span class="parent">&lt; ActiveStorage::Representations::BaseController </span> </h2> <ul class="files"> <li><a href="../../../files/activestorage/app/controllers/active_storage/representations/redirect_controller_rb.html">activestorage/app/controllers/active_storage/representations/redirect_controller.rb</a></li> </ul> <div id="version-badge">v8.0.0</div> </div> <main id="bodyContent"> <div id="content"> <div class="description"> <p>Take a signed permanent reference for a blob representation and turn it into an expiring service URL for download.</p> <p>WARNING: All Active Storage controllers are publicly accessible by default. The generated URLs are hard to guess, but permanent by design. If your files require a higher level of protection consider implementing <a href="https://guides.rubyonrails.org/active_storage_overview.html#authenticated-controllers">Authenticated Controllers</a>.</p> </div> <!-- Method ref --> <div class="sectiontitle">Methods</div> <dl class="methods"> <dt>S</dt> <dd> <ul> <li> <a href="#method-i-show">show</a> </li> </ul> </dd> </dl> <!-- Methods --> <h2 class="sectiontitle">Instance Public methods</h2> <div class="method"> <h3 class="title method-title" id="method-i-show"> <b>show</b>() <a href="../../../classes/ActiveStorage/Representations/RedirectController.html#method-i-show" name="method-i-show" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-show_source')" id="l_method-i-show_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activestorage/app/controllers/active_storage/representations/redirect_controller.rb#L10" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-show_source" class="dyn-source"> <pre><span class="ruby-comment"># File activestorage/app/controllers/active_storage/representations/redirect_controller.rb, line 10</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show</span> <span class="ruby-identifier">expires_in</span> <span class="ruby-constant">ActiveStorage</span>.<span class="ruby-identifier">service_urls_expire_in</span> <span class="ruby-identifier">redirect_to</span> <span class="ruby-ivar">@representation</span>.<span class="ruby-identifier">url</span>(<span class="ruby-value">disposition:</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:disposition</span>]), <span class="ruby-value">allow_other_host:</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">end</span></pre> </div> </div> </div> </div> </main> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10