Dynamic where param on has_many relationship

Hi! How can i pass the id from the selected article, to make dynamic the "where" clause on a "has_many" relationship ? As example, i want to edit an article, and shows the tags of the current article.



  • edited 6:13AM
    You can use a placeholder like so in the has many where clause:
    ...'where' => 'my_field = {field_name}'...
  • edited 6:13AM
    Great, thanks! I want to sort it using a different field to default. How can i setup this field?
  • edited 6:13AM
    You can use 'order' as well as 'where'.
Sign In or Register to comment.