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.

Thanks,

Comments

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