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

Overriding URL for a revision creates an invalid url for a revision=>404 #59

Closed
msevestre opened this issue May 22, 2012 · 11 comments
Closed

Comments

@msevestre
Copy link
Collaborator

@msevestre msevestre commented May 22, 2012

Step to reproduce
1 - Create a new blog entry
2 - Set the URL to "blah"
3 - Save the post

Going to the home page (not in the admin section), the newly created blog is visible and the url points to /blah
However clicking on the url returns a 404

The page you were looking for doesn't exist.
You may have mistyped the address or the page may have moved.

@jipiboily
Copy link
Owner

@jipiboily jipiboily commented May 22, 2012

What is the mount point of your app? I suspect it is not root maybe?

@msevestre
Copy link
Collaborator Author

@msevestre msevestre commented May 22, 2012

yes indeed.
mount Monologue::Engine, :at => "/monologue"

This is using the default mount point in the dummy application
I'll try to write a test to reproduce that error

@jipiboily
Copy link
Owner

@jipiboily jipiboily commented May 23, 2012

It is not a bug in Monologue in fact. If it is mounted in "/monologue", it can't handle any route of the main_app, only it's own routes in "/monologue/whatever".

Any suggestion? Maybe a validation to make sure url is starting with mount point?

@msevestre
Copy link
Collaborator Author

@msevestre msevestre commented May 23, 2012

Well I believe this is more a 'Monologue' bug than a 'user' bug. A non tech-savvy user might have some trouble understanding why this behaves like that.

My suggestion would be:
1 - in posts_revisions, do not prepend #{Monologue::Engine.routes.url_helpers.root_path} when generating a url

self.url = "{year}/#{self.title.parameterize}" if self.url.nil? || self.url.strip == ""

instead of

self.url = "#{Monologue::Engine.routes.url_helpers.root_path}#{year}/#{self.title.parameterize}" if self.url.nil? || self.url.strip == ""

2 - Then instead of using

<%= link_to revision.title, revision.url %>

use sthg like

<%= link_to revision.title,"#{Monologue::Engine.routes.url_helpers.root_path}revision.url" %>

The url are then consistent and do not depend on the mounted path.
Does it make sense?

@jipiboily
Copy link
Owner

@jipiboily jipiboily commented May 23, 2012

Would certainly make sense! Thanks for the suggestion.

@msevestre
Copy link
Collaborator Author

@msevestre msevestre commented May 23, 2012

I'll make a pull request :-)

@msevestre
Copy link
Collaborator Author

@msevestre msevestre commented May 23, 2012

hum..I just tried with prepending /monologue to my previous url. It still does not work.
The path looks like /monologue/blah but I still get a 404
Maybe a routing problem?

@jipiboily
Copy link
Owner

@jipiboily jipiboily commented May 26, 2012

PR #64 was merged. Thanks!

@ShoaibRana
Copy link

@ShoaibRana ShoaibRana commented Dec 11, 2014

jquery validation is not working in monologue can somebody help plz???

@msevestre
Copy link
Collaborator Author

@msevestre msevestre commented Dec 11, 2014

What's the problem. Please be so kind and explain your issue. We cannot
help otherwise
On Dec 11, 2014 4:24 AM, "Shoaib Rana" notifications@github.com wrote:

jquery validation is not working in monologue can somebody help plz???


Reply to this email directly or view it on GitHub
#59 (comment).

@ShoaibRana
Copy link

@ShoaibRana ShoaibRana commented Dec 12, 2014

problem resolved and thakx msevestre

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants