[Rails] Re: Re: Re: How do I add my own posts plus following users post with Acts_As_Follower Rails 4

2016-03-02 Thread David Williams
Colin Law wrote in post #1181854: > On 2 March 2016 at 22:06, David Williams wrote: > Just to point out that the fundamental mistake you made here was > calling it @following_activities. If you had called it > @following_posts or something similar then you would probably fnot > have made the err

Re: [Rails] Re: Re: How do I add my own posts plus following users post with Acts_As_Follower Rails 4

2016-03-02 Thread Colin Law
On 2 March 2016 at 22:06, David Williams wrote: > Colin Law wrote in post #1181852: >> On 2 March 2016 at 21:43, David Williams wrote: >>> Iterating over the @following_activities instance variable is giving me >>> errors for user.avatar.url and user.post. I don't understand why it's >>> not coll

[Rails] Re: Re: How do I add my own posts plus following users post with Acts_As_Follower Rails 4

2016-03-02 Thread David Williams
Colin Law wrote in post #1181852: > On 2 March 2016 at 21:43, David Williams wrote: >> Iterating over the @following_activities instance variable is giving me >> errors for user.avatar.url and user.post. I don't understand why it's >> not collecting all of the information from the user object. >>

Re: [Rails] Re: How do I add my own posts plus following users post with Acts_As_Follower Rails 4

2016-03-02 Thread Colin Law
On 2 March 2016 at 21:43, David Williams wrote: > Iterating over the @following_activities instance variable is giving me > errors for user.avatar.url and user.post. I don't understand why it's > not collecting all of the information from the user object. > > <% if @following_activities.any? %> >

Re: [Rails] How to match a literal colon in a route

2016-03-02 Thread Matt Jones
I did some digging on this, and I couldn't find a way to make this work with a literal in the route itself. Splatting works, though: get 'baz/*ark_tag/:id/bar' => 'welcome#index', constraints: { ark_tag: 'ark:' }, as: :ark will only match paths like "/baz/ark:/123/bar". It's a little fussy

[Rails] Re: How do I add my own posts plus following users post with Acts_As_Follower Rails 4

2016-03-02 Thread David Williams
Iterating over the @following_activities instance variable is giving me errors for user.avatar.url and user.post. I don't understand why it's not collecting all of the information from the user object. <% if @following_activities.any? %> <% @following_activities.each do |user| %>

[Rails] Re: How do I add my own posts plus following users post with Acts_As_Follower Rails 4

2016-03-02 Thread David Williams
Colin Law wrote in post #1181847: > On 2 March 2016 at 18:47, David Williams wrote: >> Post.where(user_id:following_ids).order("created_at >> desc").paginate(page:params[:page]) > > Also, assuming that you have User has_many following_users and User > has_many posts then you should be able to say

[Rails] Re: Re: How do I add my own posts plus following users post with Acts_As_Follower Rails 4

2016-03-02 Thread David Williams
Mahcsig wrote in post #1181846: > def feed > following_ids = current_user.following_users.map(&:id) > following_ids << current_user.id > @following_activities = > Post.where(user_id:following_ids).order("created_at > desc").paginate(page:params[:page]) > end > > > ~Mahcsig I'm getting an err

Re: [Rails] How do I add my own posts plus following users post with Acts_As_Follower Rails 4

2016-03-02 Thread Colin Law
On 2 March 2016 at 18:47, David Williams wrote: > I've been trying to combine my own post with the users that I follow in > chronological order DESC. Can you help me build the proper query method > for it? > > > What I currently have is the code below > > def feed > following_ids = current_user.

Re: [Rails] Re: How do I add my own posts plus following users post with Acts_As_Follower Rails 4

2016-03-02 Thread Mahcsig
def feed following_ids = current_user.following_users.map(&:id) following_ids << current_user.id @following_activities = Post.where(user_id:following_ids).order("created_at desc").paginate(page:params[:page]) end ~Mahcsig On Wed, Mar 2, 2016 at 1:04 PM, David Williams wrote: > Mahcsig wr

[Rails] Re: How do I add my own posts plus following users post with Acts_As_Follower Rails 4

2016-03-02 Thread David Williams
Mahcsig wrote in post #1181844: > How about just adding the current_user.id to the following_ids array? > You > could then pull all the posts in one shot, and remove the next two > lines. > > ~Marc > > > ~Mahcsig > > On Wed, Mar 2, 2016 at 10:47 AM, David Williams Can you write-out your approach

Re: [Rails] How do I add my own posts plus following users post with Acts_As_Follower Rails 4

2016-03-02 Thread Mahcsig
How about just adding the current_user.id to the following_ids array? You could then pull all the posts in one shot, and remove the next two lines. ~Marc ~Mahcsig On Wed, Mar 2, 2016 at 10:47 AM, David Williams wrote: > I've been trying to combine my own post with the users that I follow in >

[Rails] Quickly get a free and trusted SSL certificate for your domain

2016-03-02 Thread tobias
Hi! I've published a small app which makes it quite easy to get a free and trusted SSL certificate. The app is available at https://tlsify.herokuapp.com/. It's in an early stage so there are a lot of bugs but the main features should work if the request is done correctly. - Just insert your

[Rails] How do I add my own posts plus following users post with Acts_As_Follower Rails 4

2016-03-02 Thread David Williams
I've been trying to combine my own post with the users that I follow in chronological order DESC. Can you help me build the proper query method for it? What I currently have is the code below def feed following_ids = current_user.following_users.map(&:id) @following_activities = Post.where(u

[Rails] (╯°□°)╯︵ ┻━┻ table_flipper gem

2016-03-02 Thread Lazarus Lazaridis
Hello everybody, Another useless gem (table_flipper) that prepends the table flipper (╯°□°)╯︵ ┻━┻ to exceptions is out there: https://github.com/iridakos/table_flipper -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from

Re: [Rails] adding descriptions to images displayed in bluimp image gallery

2016-03-02 Thread Matt Jones
On Tuesday, 1 March 2016 18:07:51 UTC-5, fugee ohu wrote: > > > > On Monday, February 29, 2016 at 9:22:55 PM UTC-5, Walter Lee Davis wrote: >> >> >> > On Feb 29, 2016, at 8:39 PM, fugee ohu wrote: >> > >> > >> > >> > On Monday, February 29, 2016 at 9:39:28 AM UTC-5, Walter Lee Davis >> wrot