Permalink
Browse files

fixed gear list and blogs

  • Loading branch information...
1 parent f16ea70 commit 053f4e17b3459ce46615b7385a928762bde56464 @chrismatthieu committed May 29, 2011
@@ -5,7 +5,7 @@
class AccountsController < ApplicationController
skip_before_filter :login_required, :except => :logout
skip_after_filter :store_location
- layout 'plain'
+ # layout 'plain'
@@ -33,7 +33,8 @@ def index
@hambrief ||= Hambrief.find(:all, :order => 'updated_at DESC', :limit => 1)
@qst ||= Review.find(:first, :order => 'timestamp DESC', :limit => 1)
# @gear ||= Product.find(:all, :order => 'created_at DESC', :limit => 3)
- @gear ||= Gear.find(:all, :order => 'created_at DESC', :limit => 3)
+ @gear ||= List.find(:all, :order => 'created_at DESC', :limit => 3)
+ # @gear ||= Gear.find(:all, :order => 'created_at DESC', :limit => 3)
render
}
@@ -13,17 +13,17 @@ def blogs_li blogs
def blog_body_content blog
-# youtube_videos = blog.body.scan(/\[youtube:+.+\]/)
-# b = blog.body.dup.gsub(/\[youtube:+.+\]/, '')
-# out = sanitize textilize(b)
-# unless youtube_videos.empty?
-# out << <<-EOB
-# <strong>#{pluralize youtube_videos.size, 'video'}:</strong><br/>
-# EOB
-# youtube_videos.each do |o|
-# out << tb_video_link(o.gsub!(/\[youtube\:|\]/, ''))
-# end
-# end
-# out
+ youtube_videos = blog.body.scan(/\[youtube:+.+\]/)
+ b = blog.body.dup.gsub(/\[youtube:+.+\]/, '')
+ out = sanitize textilize(b)
+ unless youtube_videos.empty?
+ out << <<-EOB
+ <strong>#{pluralize youtube_videos.size, 'video'}:</strong><br/>
+EOB
+ youtube_videos.each do |o|
+ out << tb_video_link(o.gsub!(/\[youtube\:|\]/, ''))
+ end
+ end
+ out
end
end
View
@@ -1,5 +1,5 @@
class List < ActiveRecord::Base
- has_many :products
+ belongs_to :product
belongs_to :profile
def after_save
@@ -17,15 +17,16 @@ truncate = truncate.nil? ? true : truncate
</tr>
<tr>
<td valign="top" style="padding-left: 8px; width: 89px;">
-<%= link_to image_tag(gear.profile.gravatar_url, :width => "50"), gear%>
+<% @profile = Profile.find(gear.user_id) %>
+<%= link_to image_tag(@profile.gravatar_url, :width => "50"), '/' + @profile.user.login%> <%= link_to @profile.user.login, '/' + @profile.user.login %>
</td>
<td class="feature_summary" valign="top" style="padding-left: 8px; width: 306px;">
- <strong><a href="<%= '/products/' + gear.id.to_s %>"><%= sanitize gear.title %></a></strong>
+ <strong><a href="<%= '/products/' + gear.product_id.to_s %>"><%= sanitize gear.product.name %></a></strong>
<!p>
<div class="comment_message jstruncate">
- <%= sanitize textilize(gear.desc) %>
+ <%= sanitize textilize(gear.product.description) %>
</div>
<!/p>
</td>
View
Oops, something went wrong.
@@ -0,0 +1 @@
+{"local_tables_info":{"feeds":195257,"messages":963,"users":2208,"clubs":93,"gears":32,"reviews":53,"adverts":2,"forum_posts":368,"photos":1177,"companies":122,"group_rosters":0,"schema_migrations":46,"aprsupdates":1,"forum_topics":156,"products":573,"contacts":165595,"groupers":209,"sessions":5621956,"articles":0,"comments":1380,"forums":751,"profiles":2268,"tags":86,"events":66,"hambriefs":68,"statuses":8363,"blogs":477,"forums_users":0,"ratings":307,"feed_items":18590,"groups":24,"lists":3056,"taggings":159,"categories":0,"friends":2524,"repeaters":14223},"session_uri":"/sessions/2844788305","stream_state":{},"table_filter":null,"completed_tables":["groups","feed_items","adverts","friends","profiles","messages","feeds","comments","forum_topics","lists","schema_migrations","photos","forum_posts","repeaters","ratings","statuses","hambriefs","forums_users","events","tags","companies","products","aprsupdates","forums","groupers","reviews","clubs","categories","contacts","gears","users","articles"],"database_url":"mysql://root@127.0.0.1/73slove_development?encoding=utf8","remote_url":"http://heroku:osui59a24am79x@taps3.heroku.com","klass":"Taps::Push"}

0 comments on commit 053f4e1

Please sign in to comment.