MiniProfiler not showing up on the page - ruby-on-rails

I’m having problems getting MiniProfiler to show me the reports. I’m just in the Dev environment, which should show it all the time. Adding ?pp=help does bring up the help page. In tmp/miniprofile, there are a ton of mp_timers_ files. Apparently something is happening back there.
At first I thought it was a weird CSS issue, like my navigation bar is covering it. I tried loading the page without CSS and the MiniProfile box still doesn’t show up.
In case it matters, I do not have a before_filter set up. When I use the simple one from their docs, though, it doesn't help anything.

My first thought is that it is disabled by default. If that is the case you will not be able to see the help page. From what you described it seams to be working. So my solutions is to type this into the browser and see what happens.
http://localhost:3000/?pp=enable
after that you should be able to get to help page.
http://localhost:3000/?pp=help

I know this is very late, but another potential issue that may cause this problem is JS errors.
If there are any unresolved JS errors, the badge likely won't show up.
So make sure to squash those before pulling your hair out.

I didn't have it show up either due to having an old version of the gem without the currently needed initializer.
To fix it, I just ran the generator which added an initializer to set up rack-mini-profiler in development:
bundle exec rails g rack_profiler:install

MiniProfiler can also be set hidden by default
# config/initializers/mini_profiler.rb
Rack::MiniProfiler.config.start_hidden = true

Related

Bootstrap for Solidus frontend

I am using Solidus for the first time. I have been able to have it working as required. However, I am trying to make changes to the frontend. Although I'd rather use bootstrap 4, I could only find a way to port it with bootstrap 3 using a gem as described here.
I have followed the instruction as explained on the page. However when I make the test changes described, expecting to see the same changes, nothing happens. In fact the page is no longer structured as it was initially which I suppose is due to overwriting all.css used by spree on the app.
I am not sure why things are not working. I tried to undo changes by running rails destroy solidus_bootstrap_frontend:install but this doesn't restore the changes. Any help would be appreciated.
Thanks.
run
rails solidus_bootstrap_frontend:install
It'll tell you what files it tries to create, and will probably ask if you want to overwrite them.
Delete these files and you'll reset the appearance to how it was before you ran the command

Controller edits in devise-token-api not recognized

I downloaded a devise example and got it working. When trying to edit a controller app/controllers/api/v1/sessions_controller.rb and test it, any changes I make are not recognized by rails.
Neither syntax errors nor legit ruby code have any effect on the app's behavior. The only source file I can successfully edit is app/controllers/application_controller.rb.
I am coming back to rails after a few years away and have never seen this behavior. Is there a controller cache, a pre-compiled module, or some other known issue causing this?
Thanks, in advance.
EDIT:
This problem has been avoided in my code. Answers are still welcome to get the gist of the explanation to the problem.

Models not reloading in development in Rails (3.2.11) project

I've searched fairly extensively for any advice and have yet to find it so, here goes:
My Rails project fails to automatically reload models in development. Reloading them currently requires a full server restart.
Previous instances of this issue have been related to non-activerecord files placed in the models directory, though this is not the case for me.
config.cache_classes is properly set to false in my development config file. Views and controllers reload without issue.
All of my rails components are version 3.2.11. I have tried disabling all of my development-specific gems to no avail. This is obviously not a productivity stopper, but it is quite an annoyance. Any help appreciated and I am happy to provide more information if it would help, though I am not using any exotic gems.
Thanks!
Some possibilities:
You are not really running on developement environment
You are changing a model within a namespace and didn't told rails to autoload the path
You are changing a file that is included in your class, not your class directly (or any of the many variants for this)
You are caching classes
Considerations:
Things might change according to the webserver you are using
How do you know it's not reloading?
I ask my question because I was having the exact same issue when I was trying to insert a debugger into what I thought was a piece of code that was being executed. I assumed the model wasn't being reloaded since it was not hitting the debugger but it was actually a call back that was redirecting me around the code with the debugger line in it.
So, it might be something other than your models not being reloaded.

Why does the Rails Debugger not default to Autoreloading?

This drove me nuts for the longest time and I thought my rails s was not reloading my code when in fact the debugger was not reloading it.
Then I found from this post that auto-reloading is not default. WHY NOT???
If you are debugging code, and you see an error, you are clearly trying to change it. And when you change it and the debugger keeps your old buggy code, what's the point?
I would like to set autoreloading to default but right now you have to do this:
rdebug reads its configuration file at startup.
create a file ~/.rdebugrc with this content:
set autoreload
or an explanation of how I am using the debugger incorrectly. Thank you very much!
This Pivotal Labs article should give the answer.
Caveat: This worked on my Ubuntu environment, but in my current setup (Mac OS X) I can't get changes in controllers auto reloaded even with this. Could you let me know your setup and if it works for you?

Delete/Destroy method doesn't work anymore? (Rails)

I'm encountering a very strange problem: my delete actions in rails don't work anymore.
Even if I create everything by the scaffold command, every click on delete just sends me to the show view of the object, which should be deleted.
script/generate scaffold myitem description:text
This isn't only in one project, but extends to new projects I create.
Any idea, where this is coming from? Or better: Any idea how to fix this?
(the only thing I can think of, is that some plugin broke my installation, I installed paperclip, but don't know how to uninstall it: where are my plugins?)
Removing link to jquery helped me.
You should be able to look in the log file to see what SQL is being generated for the delete, and what error it is being generated.
Actually the problem was probably Firefox. When I clicked on Answer you own question here on Stackoverflow, I had the very same problem: My request, wasn't processed properly. I was sent back to the normal question view, without having the ability to submit my own answer.
So after a restart of Firefox everything worked fine.
(I also reinstalled Ruby and Rails at the same time, so I can't be sure, if it was Firefox for sure).
I've seen this before (because I had the same problem). Perhaps this could help you:
Rails 3 :method=> :delete doesn't work in Internet Explorer
I follow this blog step by step and solve it!

Resources