Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/logic out of templates #74

Closed
wants to merge 32 commits into from
Closed

Feature/logic out of templates #74

wants to merge 32 commits into from

Conversation

adelevie
Copy link
Contributor

@adelevie adelevie commented Jun 8, 2014

Still a few more templates to fix, WIP.

@@ -2,7 +2,7 @@
<span class="left"><%= link_to( category.name, category_path(category.id) ) %></span>
<p class="right">
<ul>
<%= render :partial => 'home/article', :collection => category.articles.by_access_count.limit(3) %>
<%= render :partial => 'home/article', :collection => category.articles[1..3] %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use by access count and use .limit(3)? Currently it's taking articles 2-4.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I guess I was biased against having AR methods in the view--but we already have Category#by_access_count in there so it probably won't hurt to keep #limit.

FIXED

Sent from my iPhone

On Jun 9, 2014, at 4:35 AM, Justin Grevich [email protected] wrote:

In app/views/home/_category.html.erb:

@@ -2,7 +2,7 @@
<%= link_to( category.name, category_path(category.id) ) %>

    - <%= render :partial => 'home/article', :collection => category.articles.by_access_count.limit(3) %> - <%= render :partial => 'home/article', :collection => category.articles[1..3] %> Why not use by access count and use .limit(3)? Currently it's taking articles 2-4.


Reply to this email directly or view it on GitHub.

@adelevie
Copy link
Contributor Author

Good to go, @pui. I want to hear back from @hale re codeforamerica/honolulu_answers#60 and circle back for the CSS stuff. Until then, everything here is ready to merge.

@adelevie
Copy link
Contributor Author

Per codeforamerica/honolulu_answers#60, I will pull out _pagedown.html.erb -- in a new PR.

@pui
Copy link
Contributor

pui commented Jun 10, 2014

Please rebase.

jgrevich added 2 commits June 10, 2014 10:34
This adds basic test coverage (happy path and other simple examples)
for the controllers.  It also removes a bunch of unused code where
appropriate.
@adelevie
Copy link
Contributor Author

rebased

@migurski
Copy link

Hi, thanks for this. It's going to be a few days before we can look at it again!

jgrevich and others added 20 commits June 10, 2014 21:31
[cleanup] Fixes typo in spec declaration
Conflicts:
	spec/models/article_spec.rb
There is a bug in the category#index view since it is expecting an
article object to exist. It seems it was intended to only display
categories with published articles so I added the code needed for that
(and tests). I also moved dotenv-rails in the Gemfile so that it is
included in the production env.
adelevie and others added 10 commits June 10, 2014 22:14
There is a bug in the category#index view since it is expecting an
article object to exist. It seems it was intended to only display
categories with published articles so I added the code needed for that
(and tests). I also moved dotenv-rails in the Gemfile so that it is
included in the production env.
There is a bug in the category#index view since it is expecting an
article object to exist. It seems it was intended to only display
categories with published articles so I added the code needed for that
(and tests). I also moved dotenv-rails in the Gemfile so that it is
included in the production env.
@pui pui closed this Jun 25, 2014
@jcody
Copy link
Member

jcody commented Jan 25, 2015

Was this PR ever addressed/merged?

I'm seeing a failing Travis build and looks like the branch has been dead for sometime now, but there's still quite a bit of value here. Wondering if anyone wants to pick it up again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants