Y
Y
yogaku2014-08-29 11:08:15
JavaScript
yogaku, 2014-08-29 11:08:15

[Rails] How to throw 404 error in 3rd level domains?

Good afternoon.
Made support for 3rd level domains according to the lesson railscasts.com/episodes/221 . But how to do that if the 3rd level domain ceased to exist, then a 404 error was shown? Now it shows 422, due to a logical error.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
A person from Kazakhstan, 2016-07-22
@LenovoId

$(document).ready(function(){
    $(".panda-filter-params-group").click(function(){
        $(".panda-filter-params-group li").toggleClass("name");
    });
});

like this try this and do not forget to describe this .name in css

B
Boris Penkovsky, 2014-08-29
@yogaku

Make a before filter in the right places that will check for the presence of the site

def check_site
    if !current_site
      redirect_to("http://#{root_cms_url}/404.html")
      return false
   end
end

in current_site I am looking for a site by subdomain

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question