Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

2 different views with forms for creating and updating articles - bad practice #336

Closed
ramusus opened this issue Dec 29, 2014 · 6 comments
Closed
Assignees
Milestone

Comments

@ramusus
Copy link

ramusus commented Dec 29, 2014

I suppose it would be better to join them into one view with one article form. Otherwise there is violatation of DRY principe. And it's much more complicated handle of the same html form in 2 different places
I can make PR If you agree with my point of view.

@ramusus ramusus changed the title 2 different views with forms for creating and updating articles 2 different views with forms for creating and updating articles - bad practice Dec 29, 2014
@JuanCaicedo
Copy link

Are you saying that say if I add a new field to the articles, say a keywords field, then I would have to separately add that both into the create view and the update view? If that's the case, I agree with you, and I wrote a blogpost about a possible way to do that, if you end up working on the PR and want ideas.

@ramusus
Copy link
Author

ramusus commented Dec 30, 2014

Yes, that's exactly what I want to say. Could you post the link you your blogpost? I already have my implementation, but it would be nice to check your ideas

@androidfred
Copy link
Contributor

I agree, this violates DRY and is bad practice, would be great if you could fix it!

@ramusus
Copy link
Author

ramusus commented Jan 1, 2015

just commited pull request

@JuanCaicedo
Copy link

My post was about using a directive and controlling the method through an attribute, but this seems much neater!

@lirantal
Copy link
Member

Seems we've already done some refactoring there on the articles module.
Closing.

@ramusus @JuanCaicedo welcome to comment and add anything else if you'd like.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants