The simplest way is to change the create permission so that it only allows 
the owner to be the creator

def create_permitted?
  user_is? acting_user
end

Hobo will then drop the user field on the form automatically.

On Saturday, June 9, 2012 8:30:39 AM UTC-6, Vivek Sampara wrote:
>
> I have a users model being automatically generated by hobo and i created a 
> new resource called "Product". Im trying a simple application like 
> inventory management . 
>
> The association im using 
>
> class Product < ActiveRecord::Base
>
>   hobo_model # Don't put anything above this
>
>   fields do
>     item      :name
>     timestamps
>   end
>
>  belongs_to  :user, :class_name => "User", :creator => true  
>
>    def create_permitted?
>     acting_user.signed_up?
>   end
>
>   def update_permitted?
>     acting_user.signed_up?
>   end
>
>   def destroy_permitted?
>     acting_user.signed_up?
>   end
>
>   def view_permitted?(field)
>     acting_user.signed_up?
>   end
>
>   *and for user *
> *  *
> * *class User < ActiveRecord::Base
>
>   hobo_user_model # Don't put anything above this
>
>   fields do
>     name          :string, :required, :unique
>     address       :string
>     email_address :email_address, :login => true
>     administrator :boolean, :default => false
>     timestamps
>   end
>   
>   children :products
>
>   has_many :products, :dependent => :destroy
>
> After i start the application. I logged into testuser1 and tried to create 
> a new product. and im getting a drop down list 
> with  <testuser1> <testuser2> <testuser3> with  <testuser1> selected . 
>
> Can i skip this dropdown from model and not with <fields-list skip="user"> 
>
> Thanks
> Vivek 
>
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/hobousers/-/xCq81O2Jq6oJ.
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