You've got some stuff named bulk_add_list and some bulk_add, it should
all have the same name.  We're creating a "virtual attribute": to the
rest of the stack, it looks like a database column, but it isn't
actually a column in the database.   So assuming that you have a
function

def bulk_add=(text)
   (do something with text)
end

def bulk_add
   ""
end

On Sun, Jan 6, 2013 at 3:46 PM, Dan Lamet <[email protected]> wrote:
> No change.  My function is still unavailable.  Here's me adding to the
> permissions functions and attr_accessible.
>
> class Blacklist < ActiveRecord::Base
>
>   hobo_model # Don't put anything above this
>
>   fields do
>     identifier :string
>     timestamps
>   end
>   attr_accessible :identifier, :bulk_add_list
attr_accessible :identifier, :bulk_add

>
> ...
>
>   def bulk_add_permitted?
>     true
>   end

You don't need this function.   Just make sure that your
edit_permitted? returns true for the :bulk_add field.


>> > <extend tag="form" for="Blacklist">
>> >    <field-list: fields="identifier, bulk_add">
>> >       <batch-entries-view:>
>> >         <textarea name="&bulk_add_list" value=""/>

"&bulk_add_list" means "return the value of the function or variable
named bulk_add_list".   Since you do not have such a variable in your
view, this is going to cause problems.

What you want is name="blacklist[bulk_add]".   If you inspect your
HTML, you'll see that's the format that Rails uses for form
parameters.

"param_name_for_this" is a view helper function in Hobo that will
return "blacklist[bulk_add]" when called in the above context.    So
you want either name="blacklist[bulk_add]" or
name="&param_name_for_this".   without the ampersand the string is a
literal, with it, the string is a function call.

Bryan

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to