First of all, I'm a complete emacs noob. So, excuse me if I said something wrong.
I could not open a template using projectile-rails-goto-file-at-point. Am I doing something wrong?
Steps to reproduce
Open emacs using the init file below.
Open a rails project: C-c p p
Select a controller
Move the cursor to the line render :template_name
Use the projectile-rails-goto-file-at-point function.
Behavior
6.1. Expected: Open template for that Controllers Action.
6.2. Current: Opens Dired showing Controllers Views directory and show error: Could not recognize the template's format
First of all, I'm a complete emacs noob. So, excuse me if I said something wrong.
I could not open a template using projectile-rails-goto-file-at-point. Am I doing something wrong?
Steps to reproduce
render :template_name
Could not recognize the template's format
https://user-images.githubusercontent.com/97436/154732351-20904a51-4874-47b5-9df1-e4c1ec9c39e8.mov
The init file
Starting emacs on Terminal. Using:
emacs --no-init-file -l bugreport.el
What I could find
I used scratch buffer to rewrite the
projectile-rails-goto-file-at-point
and add a message to understand what is the format the plugin is finding.I end up adding all variables because I have no idea how to debug it live.
Although everything looks right, I found out the function wasn't able to discover/guess the format I'm using.
Digging a little deeper I believe I found out this is caused by the lack of a default value for the function
projectile-rails-template-format
.This line expects the template format being described as:
render :new, formats: [:html]
.But, Rails could also use:
Sort of... a solution
Adding a match regular expression for the respond_to format worked for me. But, I'm not sure this is the way for a solution.
The whole function