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

Comments

Projects
None yet
3 participants
@msevestre
Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@jipiboily

jipiboily May 22, 2012

Owner

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

Owner

jipiboily commented May 22, 2012

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

@msevestre

This comment has been minimized.

Show comment
Hide comment
@msevestre

msevestre May 22, 2012

Collaborator

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

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@jipiboily

jipiboily May 23, 2012

Owner

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?

Owner

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

This comment has been minimized.

Show comment
Hide comment
@msevestre

msevestre May 23, 2012

Collaborator

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?

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@jipiboily

jipiboily May 23, 2012

Owner

Would certainly make sense! Thanks for the suggestion.

Owner

jipiboily commented May 23, 2012

Would certainly make sense! Thanks for the suggestion.

@msevestre

This comment has been minimized.

Show comment
Hide comment
@msevestre

msevestre May 23, 2012

Collaborator

I'll make a pull request :-)

Collaborator

msevestre commented May 23, 2012

I'll make a pull request :-)

@msevestre

This comment has been minimized.

Show comment
Hide comment
@msevestre

msevestre May 23, 2012

Collaborator

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?

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@jipiboily

jipiboily May 26, 2012

Owner

PR #64 was merged. Thanks!

Owner

jipiboily commented May 26, 2012

PR #64 was merged. Thanks!

@ShoaibRana

This comment has been minimized.

Show comment
Hide comment
@ShoaibRana

ShoaibRana Dec 11, 2014

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

ShoaibRana commented Dec 11, 2014

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

@msevestre

This comment has been minimized.

Show comment
Hide comment
@msevestre

msevestre Dec 11, 2014

Collaborator

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).

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@ShoaibRana

ShoaibRana Dec 12, 2014

problem resolved and thakx msevestre

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