You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Phoenix.Controller.assign/2 to match LiveView API (#6513)
Adds `assign/2` to Phoenix.Controller for consistency with the LiveView API.
This delegates to `Plug.Conn.merge_assigns/2` and provides a familiar interface
for developers moving between controllers and LiveViews.
Before:
```
conn
|> assign(:name, "Alice")
|> assign(:role, :admin)
```
After:
```
assign(conn, name: "Alice", role: :admin)
```
This mirrors the `assign/2` function available in LiveView, making the assign
API consistent across both controller and LiveView contexts
0 commit comments