Just a quick silly question , are form_helpers actually helper.rb files
?
Stuart
Just a quick silly question , are form_helpers actually helper.rb files
?
Stuart
Just a quick silly question , are form_helpers actually helper.rb files ?
If you mean are they in ruby source then yeah. You can have a look at
the source in somewhere like:
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_view/helpers/
(depending on your install).
You should find all of the code for rails in the gems folders - great
place to look to understand how it all works.
Steve
I’m sorry, Im reading about them in AWDWR and have started to read
through the API docs. What I wanted to know is the code part of the
helper files -> app\helpers or part of the .rhtml pages ?
Stuart
I’m sorry, Im reading about them in AWDWR and have started to read
through the API docs. What I wanted to know is the code part of the
helper files -> app\helpers or part of the .rhtml pages ?
Oh - helpers are in app/helpers and are ruby methods. AWDWR should
cover all that in depth.
Steve
:), so form_helpers are part of the code that goes into the app\helpers
files ?
Stuart
:), so form_helpers are part of the code that goes into the app\helpers
files ?
I’m not sure what you mean by form_helpers - are you talking about the
rails form helpers like ‘text_field’ or ‘submit_tag’?
View helpers are defined in app/helpers. So you can write methods that
will be accessible in your views:
– app/helpers/pages_helper.rb
module PagesHelper
def say(message)
message
end
end
– app/views/pages/index.rhtml
<%= say ‘Hello!’ %>
This would display:
Hello!
Hope that helps,
Steve
These are the ones I’m speaking about . Yes the text_field, etc.
http://api.rubyonrails.org/files/vendor/rails/actionpack/lib/action_view/helpers/form_helper_rb.html
I gather they are not part of the code that goes into helper files.
Stuart
http://api.rubyonrails.org/files/vendor/rails/actionpack/lib/action_view/helpers/form_helper_rb.html
I gather they are not part of the code that goes into helper files.
Sorry - i may still be a bit confused about what you mean :0)
The code for text_field and the like are effectively the same as code
you’d put into app/helpers when you write your own helper files. You
can view that code yourself as i mentioned in my previous post.
Steve
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs