How to get the content of text_area in controller?

hi all,

i have a text_area

<%= text_area :myarea, :rows => 20, :cols => 40 %>

and want to get it’s content when submit due to form_remote_tag.

how can i get it’s content where user input ?

i tried

@context = params[:myarea]

and

@context = params[:myarea][:value]

and

@context = params[:myarea][:body]

and others, but just can’t work :frowning:

any tips is appreciated.

thanks

I found if I change my code in view to :

<%= text_area :myarea, :body :rows => 20, :cols => 40 %>

and in controller:

@context = params[:myarea][:body]

then i can access it.

But I still don’t know why … ?

feng wrote:

I found if I change my code in view to :

<%= text_area :myarea, :body :rows => 20, :cols => 40 %>

and in controller:

@context = params[:myarea][:body]

then i can access it.

But I still don’t know why … ?

try text_area_tag instead of text_area

Gokhan A. wrote:

feng wrote:

I found if I change my code in view to :

<%= text_area :myarea, :body :rows => 20, :cols => 40 %>

and in controller:

@context = params[:myarea][:body]

then i can access it.

But I still don’t know why … ?

try text_area_tag instead of text_area

i tried text_area_tag and found it is really great !

thanks very much !