erb - Ruby Rescue block fails to catch Template missing code -
There is a small method to add partial to a Pedro Assistant.
- Enable an easily enabled / disabled system through a config file for components.
- Choose a language specific layout IF The requested layout is not found.
This is the code, I'm using:
module SZHF App.helpers def add_component component if disabled (component) "" partial again (Component) rescue language is used- specific (component) end-end def partial_exists? (Component) File.file? (File.expand_path (".. .. .. .. / views / # {component} (component) name = component split (" / ") final configuration [" _ _ {{}} ".s_sim] == wrong end DIF language language (sample) name = component split ("/"). Final prefix = component.com (name) partial prefix + I18n.locale.to_s + "/" + + name end end
But instead of being caught in a rescue block anyhow, the error; page indicates an error:
Undefined method
safe_concat 'for zero: NilClass'.Why not, any thoughts?
Comments
Post a Comment