Comments (4)
@xemexpress The original thinking was that you wouldn't want your URL's to change when the author makes changes to the title otherwise you could get broken links if someone linked to an article externally.
You can make the slugs update on every save by changing this line in article.rb
in the before_validation
block:
before_validation do
- self.slug ||= "#{title.to_s.parameterize}-#{rand(36**6).to_s(36)}"
+ self.slug = "#{title.to_s.parameterize}-#{rand(36**6).to_s(36)}"
end
from realworld.
This is intended functionality, no?
from realworld.
Yes though 😛 I just don't know why users shouldn't make that change (on :slug)
Any help?
from realworld.
Ahhh I understand what you're saying now. Changing the slug won't actually cause anything to break, as the frontends redirect to whatever slug you hand back in the article payload for the PUT request. So updating slugs are a "nice-to-have" but not mission critical for core functionality :)
That said, @apai4 any recs on how the Rails stack could support updating article slugs?
Btw I just updated the API spec w/ the delete call FYI, shocked no one has caught that until now!
from realworld.
Related Issues (20)
- [SWAGGER] register and login response schema issue HOT 1
- [Bug]: Line breaks not showing correctly HOT 1
- [Bug]: Immediately signed out after logging in HOT 3
- [Backend] Remove Response Envelopes HOT 5
- [Bug]: When try to build HOT 5
- User registration success status code is 200, but docs/swagger show 201 HOT 1
- [Bug]: server ERROR 500 HOT 2
- [Bug]: CORS Error HOT 9
- [Feature Request]: offline functionality HOT 2
- [Bug]: Demo server status is 503 HOT 1
- [Feature Request]: Vuetify in Realworld example HOT 1
- [Bug]: Continuous modification of user information results in an error HOT 4
- Try this HOT 1
- [Bug]: demo APIs down? HOT 2
- [Bug] initialData.data from route loader is always undefined HOT 1
- API server doesn't work HOT 1
- [Bug]: Heroku Deployment failed
- [Bug]: API doesn't work HOT 4
- [Bug]:CORS Issue HOT 1
- [Bug]: Demo backend is down HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from realworld.