-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
embeded and config.action_links.member.add #410
Comments
For render active_scaffold:, you can try with conditions: or params: instead of constraints: If you set constraints, column won't be displayed |
Hi Scambra, Yeah that fixed the display. Thanks! What is strange is I have set up an action_links member that polls the object for current state transitions and will switch them if need be to a desired state. This works very well when it is nested but when I put it by itself as a embeded scaffold controller it seems to not do the javascript update --that is update the row. It does the update behind the scenes but just doesnt complete the front end update. Not sure what the problem is. Thanks for the info scambra. You are a master at AS! config.action_links.member.add 'get_states', position: false |
Check if that action is sending eid (eid is the key to get conditions of embedded scaffold) and post here server response for that action |
New unseen
![screenshot from 2015-03-12 11 25 47](https://cloud.githubusercontent.com/assets/39400/6621056/b42f744e-c8aa-11e4-99de-4eb806415943.png)
It is almost doing what it is suppost to do. It just aint updating the frontend. I looked in the firebug console and it looks like a js error: TypeError: action_link is undefined which is this line in active_scaffold.js if (action_link.loading_indicator) action_link.loading_indicator.css('visibility','hidden'); |
it's weird because it's inside If (action_link) and it has been used in previous lines:
Do you have any listener for as:action_success? |
Hi Scambra, def get_states
@record = find_if_allowed(params[:id], :read)
end
def state_change
#@record = find_if_allowed(params[:id], :update)
event_name = params[:event]
# call the event on AASM (state_machine)
event = "#{event_name}!".to_sym
# this will update the row in the database and the table.
process_action_link_action do |record|
if (record.send(event))
puts "CALLED RECORD SEND"
flash[:info] = as_("Record Updated: #{record.title} to: #{event_name}".to_sym)
else
flash[:error] = as_(:error)
end
end
end |
The embed stuff not working seems really strange. It only works if I do a target = top like such: = link_to "View Details", pursuing_aasm_path('pursuing'), {target: 'self'} otherwise it doesnt display any rows unless I do a reload. The it displays them. |
I don't follow you What's not working? are reject, keep and pursue links working on normal scaffolds and failing on embedded ones? Or is displaying a embedded scaffold not working? Please don't mix issues |
I have a controller like: which seems to work just fine for this ajax function when it is nested. It update the gui (as stated above) when called as an embeded scaffold it doesnt complete the javascript update. It does the model update fine and dandy though. |
So, it's displaying submenu when it's nested, but not when embedded, right? |
That is right. Not sure why but it works great when it is a submenu for some reason. It doesnt update the html on the embed, but it does do the database update. So it is halfway working... |
What database update? I don't see any update on get_states action |
HI All,
I think I might have found a few bugs in AS. The first as to do with embeded sacffolds when they are called on a blank page by themselves.
so if I do something like in slim:
h3= "New #{@aasm_state}"
= render active_scaffold: 'google_search_results', constraints: { :aasm_state => @aasm_state }
My param is passed but it doesn't make any rows. When I do the same page with a target of 'self' or blank it does work...hmmm. Not sure what the problems is.
This works but pops a new window:
= link_to "View Details", pursuing_aasm_path('rejected'),{target: 'self'}
I wanted to make a single page that would display certain aasm_states...
The other potential problem is config.action_links.member.add
This seems to work fantastic as long as it is a nested scaffold. I want to use the pages above to do the same thing as what happens when it is in the nested scaffold but for some reason when it goes into a 'blank' page it drops the fields search_type, :aasm_state. Not sure why this is being dropped but it breaks the convention I am working on.
Any help would be totally appreciated.
Thanks so much!
Mark
The text was updated successfully, but these errors were encountered: