Closed rudokemper closed 2 years ago
Hey, is this issue still relevant, and is it a good one to start with?
Are there more high-priority issues on this project that need to be addressed and which are a similar level of complexity?
Hi @andersan, yes this issue is super relevant still, and I imagine it's a good one to become acquainted with the Rails and media storage side of things. Any help would be highly appreciated! I can assign you if you're interested in taking a look.
I can answer the other question a bit later on in the week.
@rudokemper just got the app set up locally and added a story, speaker and place to see how it all works.
Is this the same error you're seeing? I haven't worked with Rails in a while but can dig into it if it's the same one.
Interestingly no, when removing Media
we are seeing this view:
Is that the same pathway that you took? Add Media, and then try to remove?
Maybe it is a configuration issue with the way the app is set up on my local environment. I'm running ubuntu 20.04, a fresh install of docker, and using Chrome to test.
Steps I took to get there:
In the terminal running the local server/docker, this is the output when this error happens:
Started DELETE "/admin/stories" for 172.18.0.1 at 2022-03-02 14:42:02 +0000
Cannot render console from 172.18.0.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
ActionController::RoutingError - uninitialized constant StoriesController:
Started POST "/__better_errors/71f105941e69c37a/variables" for 172.18.0.1 at 2022-03-02 14:42:02 +0000
Cannot render console from 172.18.0.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Since there is no EDITOR or BETTER_ERRORS_EDITOR environment variable, using Textmate by default.
After making some changes to the rails/config/environments/development.rb file as suggested here, the error message is slightly different ("Cannot render console" messages shown above no longer appear):
Started DELETE "/admin/stories?attachment_id=3&record_id=6" for 172.18.0.1 at 2022-03-02 15:05:14 +0000
ActionController::RoutingError - uninitialized constant StoriesController:
Started POST "/__better_errors/5001f7e0e0a43da5/variables" for 172.18.0.1 at 2022-03-02 15:05:14 +0000
Since there is no EDITOR or BETTER_ERRORS_EDITOR environment variable, using Textmate by default.
Note that after making those changes to the development.rb file, I can create, update and delete a story without any issue.
Nice! This change permits you to remove a media attachment from a story as well? If so, please do feel free to submit a PR and we can test it out!
The above issue was just a local config issue. My IP wasn't recognized - I'll commit that change in case it helps future developers.
I added a new stories controller outside the Admin context via "rails g controller stories". In the master branch, the Stories controller only exists in the admin folder. Adding that controller changes the error message to the following:
The action 'delete' could not be found for StoriesController
Adding "delete" to the admin stories controller might fix the issue, but I'm not sure. I'm a rails novice (work a lot more with JS/node.js) so am learning as I make these changes.
Think the issue was:
This should be fixed. Removing images/attachments and deleting stories both seem to work with these changes. I wa sn't sure if the change would result in story deletion being broken.
PR here: https://github.com/Terrastories/terrastories/pull/713
Describe the bug Currently, it seems like an error is being thrown when trying to remove media attachment from the Story edit view in Administrate. The expected behavior is that clicking the "Remove" button should remove the media attachment, but instead we are taken to a Rails error page.
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots