Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (19 sloc) 532 Bytes
class Topics::IndexPage < MainLayout
needs topics : TopicQuery
needs vote_form : VoteForm
def inner
h1 "Topics"
link "New Topic", to: Topics::New
ul do
@topics.each do |topic|
li do
text topic.votes.size.to_s
link topic.title, to: Topics::Show.route(topic)
link "Edit", to: Topics::Edit.route(topic)
link "Delete", to: Topics::Delete.route(topic)
link "+1", to: Topics::Votes::Create.route(topic_id: topic)
end
end
end
end
end