I want to use a method i have in my helper inside my controller. I don't know how to use the view_context which i've heard could do the trick
How do you gain access to the helper methods inside the controller with Rails
297 Views Asked by Vasseurth At
2
There are 2 best solutions below
Related Questions in RUBY-ON-RAILS
- How to display legend box in tooltip text for amCharts 5 in Rails application?
- how to integrate cashfree payment gateway in ruby on rails project
- RSpec Capybara throwing Selenium error when trying to click a button with browser confirm
- rails minitest not picking up fixture properly, instance variable not percolating
- Duplicate GET requests - Rails & Heroku
- How to stub out current_user in JWT model for Rspec?
- NameError in Home#index
- Verifying Google Identity OAuth2 token with Ruby
- Error WebMock::NetConnectNotAllowedError in testing with stub using minitest in rails (using Faraday)
- why is mission_control-jobs erroring with load path error?
- Rescuing validation errors from a polymorphic association
- New error on random number assigned to local variable , Rails
- How to fix error in model with gem lockbox
- Images uploaded via Active Storage not displaying in Active Admin or on certain devices
- controller test_methods generating two errors intermittently
Related Questions in METHODS
- Why does print(list.sort()) result in None?
- method doesn't fill the array with correct values - instead it leaves it at null
- How do I create a method in a class to delete the class instance?
- How can I ensure incremental changes in deciphered messages in Python substitution cipher decoding?
- Using a list of tuple and a relative item of a Tuple as an argument of a method
- How to create a list of a three sentence docstring with each element in the list being one sentence with its punctuation mark in Python?
- My search function is only matching exact strings
- How do I pass a generic function as an argument to another function in golang?
- In C#, How can an interface (such as ILogger), with 1 method signature for log(), show 5 on intellisense?
- What methods inherited from the Object class should usually be overridden?
- Method definition and objects in Java
- Argument list is changing whenever I execute a change to a separate list with removerange
- Why does my Javascript method return NaN when two number types are calculated?
- Method declaration being treated as a parameter
- How can the Toy object I get from a Child object not be the same as passed in through the constructor?
Related Questions in CONTROLLER
- godot lean mechanic makes camera glitch
- Why Jackson needs a default constructor?
- How to convert an HTML string to an escaped one?
- how to connect acb-004 controller using python
- Store files on gdrive from controller
- Laravel form action not accepting $order->id but accepting hard coded value
- Input Field Required
- Can you help a tag look at the static resource path without looking at the controller
- Reuse controller paths for a Spring Boot Controller
- How do i change a single value data into an array table in Laravel Jetstream vue stack?
- No route found in Shopware6/symfony
- Player sprite not changing when moving left or right when using a Playstation 5 Controller, but sprite changing when using keyboard controls
- problem with laravel view not extending layout.blade.php with out assets file . What can possibly be the problem?
- How apply machine learning code to ryu controller
- Nginx custom error page unexpected error reading return code: strconv.Atoi: parsing "": invalid syntax. Using 404
Related Questions in HELPER
- How To Make A Barcode Scanner In Flutter?
- Node.JS getting error while building EXE with PKG module
- trouble to trigger Jenkins job
- How can I clean up this C++ snippet for command line arguments?
- How do you configure JOGL with java in 2024 lol
- Azure function powershell script, how to implement multiple helper functions in the same Azure function?
- How can I connect the ANT+ SDK and Flutter Blue Plus to the Wahoo TICKRfit watch to retrieve data from the watch?
- What is this for? Df = pd.dataframe({"AAAA":[1,4,7]})
- Matlab Question help through an Excel table import
- Building a Strong Web Development Portfolio and Improving Skills for Internship or Job Opportunities in 2024
- Troubleshooting Responsive Design Woes: Resolving Errors and Glitches for a Seamless User Experience
- Can someone explain how to input function in auditorium?
- Using wallet methods throughout the program in laravel
- How to write python code to send data to Redis Database
- Juniper Bot in Discord
Related Questions in VIEWCONTEXT
- How to maintain the viewContext as a variable so I can leave the page while keeping viewContext saved
- Intershop - pass call parameters to component
- How do I loop through all open background view contexts and perform a save?
- Data inconsistency between coredata entity attributes in app and fetchresults query in app share extension
- Object is possibly 'undefined'. TS2532
- Can a Rails helper_method use yield as if it was invoked in the corresponding view?
- Coredata fetch request result doubles up after every request
- What's the purpose of having a ViewContext property on a Tag Helper?
- I'm trying to implement `link_to` in a flash message for an update action in a controller in Rails but I cannot get it to render to the browser
- How to use ViewContext?
- Core Data's NSPersistentContainer in iOS 10 / macOS Sierra
- Accessing Route Data from Tag Helper in ASP.NET 5 RC1
- Access to stream of ViewContext's writer
- Specify stylesheet media when rendering view with MVC ViewContext
- Caliburn Micro not support cal:View.Context at design-time?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
As apneadiving said, make it a controller method and make that a helper method.