Ruby on Rails Thursday, October 23, 2014

Hey Everyone,

I was adding an atom feed to a rails application and noticed something:

According to the docs http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-auto_discovery_link_tag
 
    auto_discovery_link_tag(:atom, {controller: "home", action: "public_archives"})`

Should return 

    <link rel="alternate" type="application/atom+xml" title="ATOM" href="http://www.currenthost.com/home/public_archives" />

but I'm getting just the host without the controller or action.

    <link href="http://currenhost.com/" rel="alternate" title="ATOM" type="application/atom+xml" />


Would anyone mind pointing me in what I might be doing wrong? I also cross posted this question on Stack Overflow if you want the rep.

http://stackoverflow.com/questions/26513739/auto-discover-link-tag-ignores-url-options

Sunny Juneja

--
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d677e6d3-87af-463e-a90a-f59c4ba10b6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Thanks Json.

Actually it is a static data and it will change rarely may be in 5 or 6
years. That's why I don't want to re-fire it.

If possible could you please brief about (1) How actual global variables
work in Ruby, and (2) how the Rails boot process works, and (3) How
A-Rels (ActiveRelation objects) work under the hood.

or provide any useful links

Thanks again,
avantec

--
Posted via http://www.ruby-forum.com/.

--
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5c02e17c028cbf195ca3429d869bc706%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Thanks, Anuj. I didn't know that nginx also makes its contribution to confusion with headers.

On Thursday, October 23, 2014 11:56:35 AM UTC+3, Anuj Dutta wrote:
Hello Roman,

I wrote a blog post about it a while ago:


I hope it helps.

Anuj



On 23 October 2014 09:39, Roman <broil...@gmail.com> wrote:
I figured, it's not related to curl but to Rails and Rack only.
Here's what I do:

  curl -v -H "hello_world: true" localhost:3000/empty

Now in the controller I dump the request headers and see "HTTP_HELLO_WORLD"=>"true". Rack converted "hello_world" to "HTTP_HELLO_WORLD".
But if I try to access the header like `request.headers[:hello_world]` or `request.headers["hello_world"]`, it will return nil.

If I used 'hello-world' instead of 'hello_world' (underscore instead of dash), everything would have worked as expected.

On Thursday, October 23, 2014 10:59:23 AM UTC+3, and...@benjamin.dk wrote:
I am not sure I understand your question, but how does the headers hash look like? maybe if you show me the result will be easier to understand the mistake!

Also gives a concrete example of which headers you trying to set.

I have always done curl requests like this:

curl -i --header "Accept: application/json" --header "Content-Type: application/json"

the -i option from the manual:

 -i, --include
              (HTTP) Include the HTTP-header in the output. The HTTP-header includes  things  like  server-
              name, date of the document, HTTP-version and more...

so you can see the answer to your curl call.

--
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-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/22f6a897-2cda-45f5-bbad-32b55e74a5d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Anuj DUTTA

--
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9678f775-62c2-4ed1-a6fc-f92a8b269558%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.