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
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
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.
>>
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? %>
>
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
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| %>
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
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
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.
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
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
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
>
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
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
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
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
16 matches
Mail list logo