I’m working on a rails 3 application which has different sub domains for specific users or mobile devices.
This is how the view structure looks like:
app/
—-views/
——–mobile/
——–admin/
It is possible to add a new view path to the pathset by simple calling
prepend_view_path(some_path)
or
append_view_path(some_path)
Now, I would like to remove them too.
Is there any way to remove any of the previously added paths from a controllers path_set?
I didn’t find any useful methods in the API and when using the standard methods I’d use on an array (like delete_at for instance) I get following RuntimeError:
can't modify frozen array
I already use different mime types for request from mobile devices for instance. It is not too bad if I can’t remove added paths. I’m just looking for a way to reset to the “default” view paths.
Rails provides other two getter and setter methods – view_paths() and view_paths= methods respectively. I believe using ‘view_paths=’ method, you can remove the dynamically appended view path.