Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to be toggled active and inactive from the /users index route #25 #33

Closed
wants to merge 1 commit into from

Conversation

daveshah
Copy link
Member

@daveshah daveshah commented Dec 3, 2016

Still WIP.

Closes #25

render(conn, "index.html", users: users)
changesets = users |> Enum.map &User.changeset/1
user_changesets = Enum.zip(users, changesets)
render(conn, "index.html", user_changesets: user_changesets)
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Serneum & @mbramson - this is what I had in mind. If you're view requires a changeset, simply supply one
¯\_(ツ)_/¯

</tr>
<div class="container">
<%= for {user, changeset} <- @user_changesets do %>
<%= render "form.html", changeset: changeset, action: user_path(@conn, :update, user), conn: @conn %>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbramson @Serneum once the changeset is available, we can then have a form/per user listed. I reused the form that was there to keep it simple but we could create another (with mo' better styling) to get the effect that's desired.

@daveshah
Copy link
Member Author

daveshah commented Dec 3, 2016

@mbramson @Serneum this approach prevents created routes for actions, still keeping things restful but providing what's needed to update users from index.

@daveshah daveshah force-pushed the 27-activate-users-from-index branch from 318dddc to 460caf7 Compare December 3, 2016 02:26
@daveshah
Copy link
Member Author

daveshah commented Dec 3, 2016

Updated and added short_form.html.eex

@mbramson
Copy link
Contributor

mbramson commented Feb 3, 2017

Closing in favor of #85, since the /users route no longer exists. That issue is a great opportunity to introduce react into this project.

@mbramson mbramson closed this Feb 3, 2017
@ericworkman ericworkman deleted the 27-activate-users-from-index branch March 6, 2017 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants