I have this method to parse a url:
def parse_url
elements = @article.url.split("/")
if(elements[0] == "http:")
@home = elements[2]
else
@home = elements[0]
end
end
In the show method I can just use @home = parse_url and it works. In
the index I don't know how to assign the proper id.
This is the index method:
def index
@articles = Article.paginate :page => params[:page], :per_page => 3
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @articles }
end
--
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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---