Yeah, thanks. I figured it out. Now I stuck with million other problems,
but this is another theme =)
среда, 13 мая 2015 г., 10:36:34 UTC+10 пользователь Scott Ribe написал:
On May 12, 2015, at 5:21 PM, Роман Ярыгин 330...@gmail.com javascript:
wrote:
I stuck exactly on recursive
.
On Tue, May 12, 2015 at 7:42 AM, Роман Ярыгин 330...@gmail.com
javascript: wrote:
Hello!
I need to grab all site data with all tree structure. Every page have
links to children pages. How to build site tree with Nokogiri? It must be
recursive page visiting and scraping all directory links
Hello!
I need to grab all site data with all tree structure. Every page have links
to children pages. How to build site tree with Nokogiri? It must be
recursive page visiting and scraping all directory links, but I can't
recognize full algorhytm. How to do that?
P.S. And I don't need to Save
Okay. Here is the solution
In ApplicationController:
before_filter do
@main_menu = Page.where(active: true, show_in_main_menu:
true).arrange(order: :position)
def menu_ids(attributes, mids = [])
attributes.map do |attribute, sub_attributes|
if sub_attributes.empty?
Hello! Please help with trouble (I think it must be obvious solution)
I have code for displaying main menu:
@main_menu = Page.where(active: true).arrange(order: :position)
It grabs all nodes with active parameter is set to true. But if the parent
node for some children is set to
This is the model:
class Page
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Ancestry
include Mongoid::Orderable
has_ancestry orphan_strategy: :destroy
orderable column: :position, base: 0
has_many :page_attachment_files
field :name, type: String
field
Hello. I have a check box in filter, that must filter all objects, where
some field value is greater than 1. How to make predicate in Ransack?
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop
Hello. Please, help me to DRY this code snippet. The task is to print div
content, but to print it in div, when i%17 ==0 and make it without div,
when not. I guess that it maybe proc or lambda will help, but I never used
it before. Or maybe it is some simpler method?
#splitter
-
Hello everyone!
I have code:
if user.role == topmanager
can :read, ActiveAdmin::Page, :name = Dashboard
can :manage, Realty, agent: {agency_id: user.agency_id}
...
And I want to add another condition, can :manage, Realty, agent: nil
How to do it? Defining it two times gets
Hello everyone!
I have strange problem. Here is the code:
model:
class ItServiceJob ActiveRecord::Base
TYPES = [[Important, 0], [Not important, 1], [SERGEY, 2]]
belongs_to :userend
view (haml):
%div{:role = main, :class = ui-content}
- job_types = ItServiceJob::TYPES
Thank you for the answers! Will try at work tomorrow!
P.S. I just copy-paste formatted text from another forum =)
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an
11 matches
Mail list logo