links in the layout - HELP

I’m trying to get my links to appear in the layout, so it’s
throughout the entire application. Here’s the code I have:

#controller - application.rb?
def get_authenticated(path, http)
request =
request.basic_auth ‘user’, ‘pass’
response = http.request(request)
@links =
@descriptions =
@times =
@i = 0
http =‘’, 443)
http.use_ssl = true
http.start do |http|
xml = get_authenticated(’/v1/posts/recent?count=10&tag=rpheath’,
http)‘post’).each do |post|
link = post.attributes[‘href’]
@links << link
desc = post.attributes[‘description’]
@descriptions << desc
time = post.attributes[‘time’]
@times << time

#layout - application.rhtml?
<% for link in @links %>

<% end %>

All of this code works fine - I just don’t know where to put it so that
it will show up in a layout that I can use across my application. Any
help on this???


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs