erb - Ruby Rescue block fails to catch Template missing code -


There is a small method to add partial to a Pedro Assistant.

  • There are two main uses for this:

    1. Enable an easily enabled / disabled system through a config file for components.
    2. 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

    Popular posts from this blog

    java - Can't add JTree to JPanel of a JInternalFrame -

    javascript - data.match(var) not working it seems -

    javascript - How can I pause a jQuery .each() loop, while waiting for user input? -