Autor Mensaje
<  Ruby  ~  Problemas sacando datos para RSS
Anime Fans
MensajePublicado: Lun Nov 20, 2006 6:22 pm  Responder citando
MCUser
MCUser


Registrado: 23 May 2006
Mensajes: 65
Ubicación: Argentina

Bien, con chrono estamos haciendo un sistema de blogs en Rails. Hoy pensaba: si vamos a hacer esto se necesita obviamente que el titulo, etc del blog pueda cambiarse desde el panel, no puede ser algo estatico y que el webmaster tenga que andar cambiando su diseño cada 2 x 3, entonces cree una nueva tabla en la db: blog_confs bien, luego genere el model y todo bien hasta que la tuve k adaptar al site:

Empeze por el RSS Feed, mi error: undefined local variable or method `blog_conf' for #<BlogController:0x39122d0>

Bien, me esta diciendo k no existe ninguna variable o metodo blog conf en el controlador Blog O.o!! bien, aquí mi def rss:

Código:

def rss
   @articles = Article.find(:all, :conditions => 'published != 0', :limit => 10, :order => 'id DESC')

   @url= blog_conf.find(:all, :conditions => "configuration_name = 'url'")
   @description= blog_conf.find(:all, :conditions => "configuration_name = 'description'")
   @owner= blog_conf.find(:all, :conditions => "configuration_name = 'owner'")
   @email= blog_conf.find(:all, :conditions => "configuration_name = 'email'")
   @title= blog_conf.find(:all, :conditions => "configuration_name = 'title'")
   render(:layout => false )
   # creo app/views/blog/rss.rhtml
  end


Ahora mi rss.rhtml

Código:

<% # This is the view for the RSS feed. %>
<rss version="2.0">
<channel>
<title><%= @title.configuration_value %></title>
<link><%= @url.configuration_value %></link>
<description><%= @description.configuration_value %></description>
<language>es-es</language>
<lastBuildDate><%= Time.now.strftime("%a, %d %b %y %H:%M:%S -0500") -%></lastBuildDate>
<pubDate><%= Time.now.strftime("%a, %d %b %y %H:%M:%S -0500") -%></pubDate>
<webMaster><%= @email.configuration_value %></webMaster>
<ttl>60</ttl>

<% for article in @articles -%>
<item>
<title><%= article.title %></title>
<excerpt><%= article.excerpt %></excerpt>
<link><%= @url.configuration_value %>/showNew/<%= article.id %></link>
<pubDate><%= article.created_at %></pubDate>
</item>
<% end -%>

</channel>
</rss>


Ps yo no veo ningun error... Diganme ustedes u.u(si saben, claro).

JÛ|_ÏÂ|\|$.$
Volver arriba
Ver perfil de usuario Enviar mensaje privado MSN Messenger
Mostrar mensajes de anteriores:   
Todas las horas son GMT - 4 Horas

Ver tema siguiente
Ver tema anterior
Página 1 de 1
Foros de discusión  ~  Ruby

Publicar nuevo tema   Responder al tema


 
Cambiar a:  

Puede publicar nuevos temas en este foro
No puede responder a temas en este foro
No puede editar sus mensajes en este foro
No puede borrar sus mensajes en este foro
No puede votar en encuestas en este foro




Powered by phpBB and NoseBleed v1.09