I'm not groking your model. Are you expecting, but not stating that you'll only 
have one instance per IP? If so, then you need to define that. 


Sent from my iPhone

On Mar 4, 2012, at 8:55 AM, Scorpio <[email protected]> wrote:

> I've built a IpLog model that logs (eureka) certain important
> information thats of key interest to me
> (See code samples below)
> I've used only the index auto actions as every other page will be
> different
> 
> First of all I wanted to transform my page to look like
> 
> <ip>   <user_id> has <action>ed <resource_url> on <created_at>
> #- <fields>
> 
> <ip> would lead to the page for the ip action that would hold the
> details of the ip. user+action+time+whois
> <user_id> would link to the user action being the details of a user
> holding their ips and actions
> 
> note that the model has no relationships but the user_id reflects the
> id of the acting_user/current_user
> 
> I've already got whois in place also the logging so now I just need to
> display it right
> 
> as far as the index page goes I've tried
> 
> <index-page>
> 
>  <content-header:/>
>   <content-body:>
>     <collection:>
>        <view:resource_url/>
>     </collection:>
>    </content-body:>
> 
> </index-page>
> 
> Regardless what i put in the vew tag it still shows Ip log 1, Ip log 2
> etc
> 
> when i try to link to /ip_logs/ip /ip_logs/user I get no route matches
> error I'm guessing I'm missing something but /ip_logs/127.0.0.1 (the
> ip value for both test entries) also shows that error and not a blank
> page or edit me here page
> 
> I know the controllers are blank for now but that should be enough to
> make the action route work in hobo right ?
> 
> class IpLogsController < ApplicationController
> 
>  hobo_model_controller
> 
>  auto_actions :index
> 
>  def ip
> 
>  end
> 
>  def user
> 
>  end
> 
> end
> 
> 
> class IpLog < ActiveRecord::Base
> 
>  hobo_model # Don't put anything above this
> 
>  fields do
>    ip :string
>    action :string
>    resource_url :string
>    user_id :integer
>    timestamps
>  end
> 
>  # --- Permissions --- #
> 
>  def create_permitted?
>    acting_user.administrator?
>  end
> 
>  def update_permitted?
>    acting_user.administrator?
>  end
> 
>  def destroy_permitted?
>    acting_user.administrator?
>  end
> 
>  def view_permitted?(field)
>    true
>  end
> 
> end
> 
> Thanks in advance
> 
> -- 
> 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.
> 

-- 
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