Somewhat new to active admin (4-5 internal apps). I've found it to be straightforward and flexible.
However, when I deploy an app to a context other than root, the menus fail.
For example given a domain, 'Rate' the menu generates a link to '/admin/rates'. No problems, all works as expected. However, if I deploy to context '/xyz' the menu still generates a link of '/admin/rates' instead of the '/xyz/admin/rates' expected.
Is there a configuration step I might have missed?
Thanks
Edit...
I'm deploying on torquebox
Tried surrounding in a scope, made me more confused. ie
/xyz/xyz/admin/rates
scope :path => '/xyz' do
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
end
In your project directory look for app/admin/rates.rb
ActiveAdmin.register Rate do
menu :url => "/app/admin/rates"
end
This will change the URL that the menu item links to only. Without affecting the routing in rails.
Related
Let's say I have some website with the name website.eu. When I deploy it and try to get access to a page online like this website.eu/about I catch the error:
"404 The page you're looking for could not be found. The resource that you are attempting to access does not exist or you don't have the necessary permissions to view it"
When I click on the link that brings me a website.eu/about it works well, but trying to type that URL in the input field it fails.
Everything works fine locally.
The project is developed using Vue3.
The project is no GitLab.
If someone helps I would appreciate it.
Hard to tell without seeing the code, but my guess is your router setup uses the web history mode, which relies on the server to have certain settings applied.
I believe switching to hash mode (while adding # to the routes) will work.
Alternatively, you can update your server to support redirects to have the html mode work.
example server configurations
I cloned polymer starter kit 1.0 and its working perfectly fine only if the url is : localhost:8080. When I tried with Eclipse and Apache Tomcat 8.0 to build a Java MVC application then URL would be as : localhost:8080/project-name.
Now the behaviour of the page navigation changed dramatically. When I start the project the URL comes as: localhost:8080/project-name/#!/project-name
But it should come like: localhost:8080/project-name and should show home page and on clicking on users or contact tab the url should be :
localhost:8080/project-name/#!/users
localhost:8080/project-name/#!/contact
but it is showing like:
localhost:8080/project-name/#!/project-name/users
localhost:8080/project-name/#!/project-name/contact
I tried to make app.baseUrl =" ";. Changed the routing.html routing for home to empty or '*'but nothing worked.
Any help would be highly appreciated.
Thanks.
You must deploy your app as "ROOT.war" to hide the projects context. The name of your project is deployed as the "context" in the URL.
Naming your app ROOT simply tells Tomcat it is the main app to run and you will indeed get below as your projects context.
localhost:8080
Don't worry about the Tomcat homepage, I simply rename it to "ROOT-1" when I really want to keep it. Also don't worry about the context while running in eclipse because it would awkward to test your app as ROOT. Just rename the .war to ROOT before launch.
When you see the "#" it usually means your are navigating to some point in an html file, i.e. looks like your app is SPA.
"#!/appComponent"
The line below simply looks like you have a SPA style page with the same name as your project with all the other pages inside of it.
localhost:8080/project-name/#!/project-name/users
I've installed the lfeditor extension, the backend module is registered as per below (ext_tables.php):
TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'SGalinski.lfeditor',
'user',
...
In other words, the backend module is registered as a submodule of the user main module.
I can't seem to be able to find the backend module though. Changing the second parameter to 'web' results in the link showing up under Web, but of course I don't want to change the original code.
How do I activate the user main module?
User menu was moved to the top bar, so modules added to it will be availble there ;) Right, this one should be probably be placed in other menu (System?), but I think that's an author's concept.
Try to activate one of the "User" extension, for example "User>User Settings". If you activate it, menu "USER TOOLS" should be visible.
To start, I followed these directions exactly as it's stated: http://dev.day.com/docs/en/cq/5-6/developing/mobile/responsive.html
The problem is, despite all of that, my Devices dropdown on the sidekick in preview mode is empty.
The list works without issue in the Geometrixx Media without issue.
I made sure I set the cq:deviceGroups and the sling:OsgiConfig as required, and also included the simulator.js in the head tags.
Edit: I have found that if I set the resourceType on the root level page to geometrixx-media/components/page, which is their working demo, it works. I have completely removed all jsp and config items from that component page and it still continues to work anyways.
Does anyone know of something that is missing from the documents, and how to fix the issue?
Thanks.
This is what I did to resolve this issue:
I am going to assume your application name is jason-riis
In CRXDE|Lite create a config folder in /apps/jason-riis/
Now create a node of:
TYPE=sling:OsgiConfig
NAME=com.day.cq.wcm.mobile.core.impl.MobileEmulatorProvider-<*alias>
*alias could be anything, I gave my application name. What it does is it will get you a unique PID when you look at it in configuration Manager
If you go to your configuration manager now, you should be able to see two MobileEmulatorProvider config settings.
Add a node property to node you just created:
NAME=mobile.resourceTypes
TYPE=String[] (you have to click multi at the end of the value textbox)
VALUE=jason-riis/components/<*page>
*page is all the components that has sling:resourceSuperType of foundation/components/page and it is a multi array so it should look like this
jason-riis/components/page, jason-riis/components/widepage, jason-riis/components/newspage
I assume you already have the cq:include for simulation in your header. This makes the devices button appear in preview mode.
Last thing is, go to your website root page's jcr:content [/content/jason-riis/jcr:content] and add node property
NAME=cq:deviceGroups
TYPE=String[]
*VALUE=/etc/mobile/groups/touch, /etc/mobile/groups/smart
*If you go to this etc path in CRXDE|Lite; you will see more relevant information in jcr:content node. This will help you in creating your own custom emulator list.
You should be able to see the dropdown now, with options of iPhone and iPad and all. I know AEM docs are frustrating, let me know if there is any confusion.
I am injecting a partial into a page using $().html(content). Part of the partial is JavaScript code in an inline script block I need to inspect. When I look in the Sources tab in the Chrome Developer Tools it doesn't show the injected content. All it shows is the original source.
Is there a way to gain access to the JavaScript?
Update
I am using Google Chrome 21.0.1180.77 but I also have Google Chrome Canary installed.
I don't have a Sources tab (Elements, Resources, Network, Scripts, Timeline, Profiles, Audits, Console).
The Elements tab always reflects the current state of the DOM, so it will show any injected scripts. EDIT: This appears to be wrong.
There's a Chrome issue about this: http://code.google.com/p/chromium/issues/detail?id=95352
You can add a specially formed comment to the injected JavaScript code, and it will then show up in the Scripts tab (but it still doesn't show up in the Elements tab, for whatever reason):
//# sourceUrl=whatever.js
How to see injected snippets:
In order for injected code to be visible, you will need to add a sourceURL comment to the top of the evaluated script, like one of the following:
//# sourceURL=//domain/file.js
//# sourceURL=http://domain/file.js
//# sourceURL=https://domain/file.js
//# sourceURL=//domain/file
Note, that without the // hinting at the protocol and some domain immediately following, then the injected snippet will not show up under sources by default.
How to see injected snippets without a protocol and domain:
Continuing, with just a file name, like so:
//# sourceURL=file.js
You will have to change the source settings by unchecking Group by folder. See image.