Ruby on Rails Saturday, October 19, 2019



On Friday, October 18, 2019 at 10:09:09 PM UTC-4, Ariel Juodziukynas wrote:
Sorry, `redirect_back fallback_location: root_path`.

El vie., 18 oct. 2019 a las 23:08, Ariel Juodziukynas (<arie...@gmail.com>) escribió:
You are using `redirect_to request.referrer` and referrer is nil if you enter the url by hand.

Use `redirect_back fallback: root_path` instead.

El vie., 18 oct. 2019 a las 22:33, fugee ohu (<fuge...@gmail.com>) escribió:


On Friday, October 18, 2019 at 9:22:09 PM UTC-4, Ariel Juodziukynas wrote:
Is the link doing a GET request or a POST request? make sure your route matches GET requests too.

El vie., 18 oct. 2019 a las 18:07, Colin Law (<cla...@gmail.com>) escribió:
On Fri, 18 Oct 2019 at 19:33, fugee ohu <fuge...@gmail.com> wrote:


On Friday, October 18, 2019 at 5:57:55 AM UTC-4, Colin Law wrote:
On Fri, 18 Oct 2019 at 09:26, fugee ohu <fuge...@gmail.com> wrote:
On one of my sites (in production) if I navigate to https://<sitename>/set_locale/ko the browser doesn't load the page but if I'm on the site and I click the  link for that url it works fine I was notified about the error by GSC

You haven't told us what you see in the rails log when you do that.  I am sure you will have looked there before asking.
Not that you have actually asked a question, just told us that you have this interesting occurrence.
Also you haven't told us what is shown in the browser console when it happens.

Colin
 

Both browser console and log say 500 internal server error 

Well that is why it doesn't show the page then.

Colin
 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsU1QbNV6i6XQGqbOmAauz-Q9o5wXwx1831%3D1dv4yEcaw%40mail.gmail.com.


  <li><span class="smaller-text"><%= link_to "한국어", set_locale_path(locale: "ko") %></span>


  get 'set_locale/:locale' => 'world#set_locale', as: 'set_locale'


   def set_locale
    I18n.locale = params[:locale] || "zh-TW"
    respond_to do |format|
        format.html { redirect_to request.referrer }
    end
  end

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/401e2df8-b4dd-42fb-9721-39491be9bed3%40googlegroups.com.

Cool Thanks Can you tell me how do I get google to crawl my site in every locale? Just the way I'm doing it now? If not that would mean I should disallow those set_locale links in robots.txt?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3a2d0526-9ea5-4adc-bf6f-57b45f1cfc27%40googlegroups.com.

No comments:

Post a Comment